Forums

how to create conditional options and values

Reqvu 20 Jan, 2021
On a multi-page form I have created a drop down with the gender options (and values) of male and female. Depending on the form users choice I would like that choice to generated additional values I can use on the next page of my form. In this case if they chose male I would like to have the additional values of he/him/his and if they chose male the additional values of she/her/hers.

On the next page of the form I am asking a questions and in the label or custom html I would like to be able to do something like:
Does {data:she}{data:he} like the color blue? and based on their gender choice from the dropdown (female for example) show"
Does she like the color blue?

and then
Is that {data:her}{data:his} favorite color?
resulting in:
Is that her favorite color?

Any advice on how to do that in Choronforms7
Max_admin 20 Jan, 2021
Answer
For the different options you can either create 2 fields and use the "Run Conditions" behavior to enable/disable any of them based on the choice in the first page!

You may also use a PHP action and check the value then return an array of options and use {var:php_name} in the dropdown options!

You may also use the PHP way for the her/his text!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Reqvu 21 Jan, 2021
Hi Max,

What kind of field?

Actually I believe I tried your first suggestion... I created 6 hidden and disabled checkbox fields with run conditions that enabled them (3 for the female options I wanted and 3 for the male options) . If they chose Female it enabled 3 different hidden checkbox fields which were all set to "selected" and created my va
luess I wanted to call.
This actually worked but about 3 days later with absolutlely no changes to the form... it suddenly didn't work any more? A cache problem? Was this the way you mean when you said field?
You need to login to be able to post a reply.