Custom form - using option list and conditionally required fields


#1

Matrix Version: 5.5.3.1

Hi,

I have one option list question type with two options: Yes and No.

If Yes is selected, two text fields should be completed. I have made both text fields conditionally required and selected “matches a regex” option. But what value should I put in this field?


(Harinder Singh) #2

Better to use Javascript to acheive this and client side form validation


(Bart Banda) #3

Since option lists post values of numbers (the number represents the option in the list), you simply just use the “is less than” validation rule, for example, if you have an option list that looks like this:

And if the user selects “Yes”, which will be position “0” in the frontend list, you’d set this validation rule on the text field that then becomes required: