Buy Now
Sign in

How set conditional dropdown CF7

roman5527 , November 02 2020, 19:08
R
roman5527 41
November 02 2020, 19:08 #394688
Hi, how i can set conditional dropdown in CF7?
my form : https://prnt.sc/vc2rh6
i want show different values in dropdown 2 based on selected value in dropdown 1.
Thanks
admin 32
November 03 2020, 13:42 #394694
 Answer
Did you check the demo form available om this feature ? New form > Demo forms > Connected Dropdowns demo
R
roman5527 41
November 03 2020, 14:06 #394699
Hi, but this demo is load valuest from database but i want my option from dropwdown.
thnaks
admin 32
November 03 2020, 14:39 #394708
So your options are a fixed list, not from a Database table ?
R
roman5527 41
November 03 2020, 15:08 #394712
Yes options from fixed list
R
roman5527 41
November 04 2020, 22:55 #394727
Hi, any idea ? thanks
R
roman5527 41
November 30 2020, 12:27 #395099
Hi, how set options from fixed list ? thanks
admin 32
December 01 2020, 14:45 #395100
Hi Roman,
it works like the database, but instead of using a "Read Data" action, you will need to use either 1 PHP action or multiple "Variables" actions, the PHP should check the value passed from the first dropdown and return an array of values, then use {var:php_name} as the data source of the "Dynamic options" setting in the 2nd dropdown!
here is an example return value to be used as the data source
return [
["text" => "option 1", "value" => "op1"],["text" => "option 2", "value" => "op2"]
];
R
roman5527 41
December 01 2020, 17:46 #395104
Hi, Max.
Thnaks. But i dont know how work it. I have demo Dynamic option dropdown.
In action view i add php : https://prnt.sc/vtrqnc
but in dropdown dynamic data i dont select this php . https://prnt.sc/vtrr6k
can you help me a little more detailed
thanks
R
roman5527 41
December 07 2020, 12:30 #395201
hi can you help me ? thanks
admin 32
December 08 2020, 01:36 #395210
the PHP action will not be selectable in the source list in the dropdown settings, just type it instead of selecting:
{var:php_4}
R
roman5527 41
December 09 2020, 10:21 #395227
Many thanks its work .
I have one question how i add condition for selected value from first dropdown . thank
R
roman5527 41
December 11 2020, 19:39 #395277
Can you help me please ? Thanks
R
roman5527 41
December 15 2020, 08:13 #395343
hi please can you help me .
I have this php code in action : https://prnt.sc/w2zqht
i have in first dropdown 3 values. I have to create 3 times this php code or can i have it in one? How i can do it ?
And how i add condition for second dropdown . thanks.