Hide a box and under certain conditions show it and make the text required form rule

  • 10 June 2020
  • 1 reply
  • 0 views

Badge +1

Hello, thanks for all of the great support. I have a form that captured three user inputs in the form of radio buttons.

Opt1 (default Yes/No): Yes; text or No; text. The yes and no has the text in the field with it.

Opt2 (default Yes/No): idem

Opt3 (default Yes/No): idem

Free text box

 

What I would like is that for any Opt if a user selects "No" then the free text box pops open AND requires that the text box not be blank. However, I'm having a difficult time implementing it. Part of the reason is that I have to use contains() because I have "Yes;text text text" and "No;text text text" for the Yes/No field. I have turned on the allow semi-colons flag.

 

Any help would be greatly appreciated.


1 reply

Badge +1

I've tried some variation of this rule code to no avail:

 

(contains(cf_result_1, "Yes")) || (contains(cf_result_2, "Yes")) || (contains(cf_results_3, "Yes))

 

Basically if Opt1 contains Yes OR if Opt2 contains Yes OR if Opt3 contains Yes show the text box AND require text input

Reply