Switcher Area, how does it work? Is there any documentation?

deltafidesign 20 Mar, 2019
I would like to know how to use the Switcher Area; I haven't found any documentation. Can someone please tell me how I could use this "field" and what's the purpose of this kind of area?

Thanks in advance.
GreyHead 20 Mar, 2019
HI deltafidesign,

As far as I can see it will show an area depending on the value of a data item. So you could show a different area depending on say a variable in the URL, a user group ID or a value from a previous form page.

healyhatman 20 Mar, 2019
There's no documentation because he literally put it in last week.
deltafidesign 20 Mar, 2019
I've tryed to add a Switcher Area in my design tab to evaluate if it can be used for my puropose. This is my scenario:
a multiple radio check.
I've setted Data provider field in Switcher Aere as {data:myradiofieldname}
I've setted the radio values in the Switcher Area Value list with the values of the myradiofieldname field and then clicked Update Areas
Switcher Areas are now updated with my values.
I fill those areas with some fields for testing purposes

For what I've understood I can use those areas to show something inside them according to the value choosed in the radio field.

Anyway it seems not working. Should I add something in the Setup tab (on load etc...)

Any idea?
healyhatman 20 Mar, 2019
The switch area is evaluated on load, not dynamically from a page event. So for example it is for if you have a page with a radio selection, and ON THE NEXT PAGE you have a switch area based on that selection.
emmexx 12 Apr, 2019

The switch area is evaluated on load, not dynamically from a page event. So for example it is for if you have a page with a radio selection, and ON THE NEXT
PAGE you have a switch area based on that selection.

Is this the recommended way to manage branching in a multipage form?

Thank you
Max_admin 12 Apr, 2019
Hi maxx,

It will switch the views displayed on the same page, its fine to use it for this!

Best regards
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
threecats 24 Jun, 2019
I really need help with this, too. I have a form, and one of the fields is called contact_purpose. Depending on which of three options they choose (radio button), the email subject will be either what they enter in another field called "subject" or one of two standard, static subjects. How would I set this up?
healyhatman 24 Jun, 2019
With a switch in submit.

Data source {data:radio field name}

Then have say

1: subject1
2:subject 2

Then in your email in the subject you put {var: switchname}
threecats 24 Jun, 2019
Ok, so I'm working on this, but now I'm running into a couple of issues.

First, when I try to use the first option, where the user enters a subject line, the email comes without the subject being set. In the radio field (named contact_purpose I have the following options:
question=I have a Question or comment
inspection=I'd like to request a free inspection
appointment=I'd like to request an appointment

I've then set up a switch action in the submit called email_subject. The data provider is {data:contact_purpose} and the values setup is:
inspection:"I would like to request a free inspection"
appointment:"I would like to make an appointment"

Then in the email action, I have as the Subject field {var: email_subject} - but there is no subject in the email that's sent.

Second - and probably related - if I select either the inspection or appointment option in the radio field (contact_purpose), nothing happens. No email is sent, and the debugger I have set to run after the email doesn't show. Absolutely nothing happens at all.
healyhatman 24 Jun, 2019
Do you have a SWITCH or an EVENT SWITCH? Because it should be the first.
healyhatman 24 Jun, 2019
Sweet well then I dunno, post a screenshot of your setup? Use if image uploading is still broken.
healyhatman 25 Jun, 2019
First and Third image aren't showing up. Says they don't exist. EDIT wait now they're working hang on
healyhatman 25 Jun, 2019
You have a space in the email subject, {var: email_subject} should be {var:email_subject}
threecats 25 Jun, 2019
OK, that solved the first issue. On the second issue, still nothing happens when I click submit when I use either of the other two options.
If you want to see it "in action", the site where I developing it is at
healyhatman 25 Jun, 2019
When you hide the "What would you like to talk about" field, you also need to disable_validation. At the moment I can't send the form because it still thinks the field you've hidden is required.
threecats 25 Jun, 2019
Hmmm... do you know which hidden field is required? I have the events set up so that if "question" is selected, the subject field is enabled, shown, and validation is turned on, but if "inspection" or "appointment" is selected, that field is disabled, hidden, and validation is turned off.
healyhatman 25 Jun, 2019
Sorry my bad, doesn't look like it's still required. But for whatever reason I can't submit the form unless the first option is selected
threecats 25 Jun, 2019
Yep, that's the problem I'm having.
healyhatman 25 Jun, 2019
Right thought you said it was submitting, but none of the actions were working. Can you send me access details to have a look
healyhatman 25 Jun, 2019
In your field events targets you had the brackets at the end of the checkboxes name still, those were not required and were interfering. The brackets are only needed in the actual field name, not in the event target name.

Additionally you're going to want to disable the "Enable server validations" option, since that doesn't work with conditionally validated fields.
threecats 25 Jun, 2019
I see that you removed the brackets. However, now the checkboxes field doesn't show up at all, regardless of which option is checked.
healyhatman 25 Jun, 2019
I put them back and it still doesn't show, nothing else changed though? Did you make any other changes?
threecats 25 Jun, 2019
Other than disable server validation, no. But I'm not seeing them in the Events for the contact_purpose field, where "service_types" is used.
threecats 25 Jun, 2019
Hey, healyhatman, have you had any further insights into what might be going on here? I had the through that possibly using service_types[] for the name and service_types for the ID was - possibly - confusing things, so I changed the name to services[]. In order to get the checkboxes working, I used that (services[]) in the events for the contact_purpose field, but it still wouldn't let me submit. Then I tried using the ID (#service_types) instead in the event, but now the checkboxes field won't show up at all.
healyhatman 25 Jun, 2019
No I haven't sorry, kept logging me out so I have up haha. I'll have another look tomorrow.
threecats 25 Jun, 2019
Thanks. I do appreciate the help!
healyhatman 26 Jun, 2019
Services was hidden because you had put "yes" for the "hidden" setting under Info. If you want to hide something on load, add the "hidden" class to the "container class" setting.

Also, my mistake the square brackets DO belong in the element identifier for your field events.

Your form wasn't submitting because your business_name field was hidden in some circumstances but the validation was still enabled. Should be working now.
threecats 26 Jun, 2019
That did the trick! Hopefully the documentation will be updated / added, but now all I need to do is put together the email body the way I want to, and it'll be GOOD to GO!

Thanks to healyhatman!
This topic is locked and no more replies can be posted.