Hello, how do I use the dynamic/conditional display of a form-group in a User Form?
USER EXPERIENCE
1. See only the first field, and no activate button
2. After the value is selected, see only the second field and the activate button
ASSUMPTIONS
I cannot use the Ajax setting because it conflicts with my other plug-ins.
I am using the Advanced view of the form settings page.
EXAMPLE USER FORM AND USER RADIO FIELDS
color-form
main-color-field (red, blue)
sub-color-field (if red is selected --> pink, magenta, scarlet; if blue is selected --> navy, light blue, teal)
PARAMETERS - WHERE DO I ADD THESE INTO THE FORM CODE BELOW?
[cred_show_group if="( $(sub-color-field) eq ‘Red' )" mode="fade-slide"]
[cred_show_group if="( $(sub-color-field) eq ‘Blue' )" mode="fade-slide"]
FORM CODE
[creduserform]
<div class="form-group">
<label>What is your favorite color?</label>
[cred_field field=“main-color-field" force_type="field" class="form-control" output="bootstrap"]
[/cred_show_group]
</div>
<div class="form-group">
<label>What shade do you prefer?</label>
[cred_field field=“sub-color-field" force_type="field" class="form-control" output="bootstrap"]
[/cred_show_group]
</div>
[cred_field field="form_submit" output="bootstrap" value=“SUBMIT" class="btn btn-primary btn-lg"]
[/creduserform]
Hello and thank you for contacting the Toolset support.
From what I see so far, you are putting a conditional block/section inside another conditional, Which, I believe won't work. Because one the enclosing condition is met, the enclosed one won't be, and vice versa. Or maybe that's just what it appears from the shared code.
If you allow me temporary access to your admin area, I can give it a look and check why is it failing. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
The above isn't actually from my site, I was trying to illustrate my question to see what's possible.
What I'm trying to learn is if Toolset can be used to get some information from a user using a user-form and user-fields, and then based on whatever they select as values of a user-field, show them either a different user-field with more refined options OR show them only a few relevant options from the same field. The below example assumes the former, as the latter seems complex.
BEFORE FORM SUBMISSION
The user sees a user-form with a user-field called main-color-field, which is a radio field.
The user sees these options: red, blue
The user selects "red" or " blue"
The user submits the form.
AFTER FORM SUBMISSION
The user sees a new radio field (perhaps inside a new form?), depending on what they submitted above:
If they submited "red" they see a field called red-color-shade, and see these options: pink, magenta, scarlet
if they submited "blue" they see a field called blue-color-shade, and see these options: navy, light blue, teal
User selects their preferred shade and submits the form.
(in addition to the above, please send me the link to submit a separate help ticket... I am using the link "Continue to report a different problem" with URL "https://toolset.com/forums/forum/professional-support/#continue" but it does not work.) thanks!
Hi, thanks for the links. I read the documentation on hooks, but am not a developer so don't know how to apply it to my case. Can you tell me where this code belongs? In the form? On the webpage? Can I add it to a PHP Snippet? Or does Toolset have a designated place for it?
This is sounding complicated, and am hoping that there's another way to look at the problem. For example, I'm often filling out forms online where it will ask me to select my State... then if I select "Illinois" the next field which is City will show only cities that are in Illinois (e.g., "Chicago"). Doesn't Toolset have an easier way to do this kind of thing? Or is everybody using hooks?
Jamal is on vacation. This is Minesh here and I will handle take care of this ticket. Hope this is OK.
It seems Jamal misunderstood your requirement.
I see you are using the conditional field display within the form and I I see you already tried to setup.
If you can share problem URL where you added the form as well as access details, Once I review your setup I will be in better position to guide you in the right direction.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
The topic ‘[Closed] Conditional Field Display in User Form’ is closed to new replies.