Conditional required fields

mkusens 10 Apr, 2013
I have a form where the clients wants a radio button selected by the user. If the user selects option a, I have to display a formatted text field in the form. If the user selects option b, I need to show some text box fields that are required. If option a is selected, I need it to bypass the required fields. How do I do this?
GreyHead 11 Apr, 2013
Hi mkusens,

Please see this FAQ which has the basic code to do this.

Bob
editartgroup 20 Jul, 2013
Hi GH,

in this FAQ, only show how to show/hide textarea, but there is no info about how to change the validation state.

I need a field is required only if there has been a particular selection in a radio group.

I searched the forum and I found a lot of post with this question, but none with the solution.

I tried to change on fly the class, but like you said in another post, this method does not work.

Could you give some response that tracks how to do it?

thanks in advance.
GreyHead 22 Jul, 2013
Hi editartgroup,

The code in the FAQ does change the validation state. Disabled elements are not validated.

Bob
This topic is locked and no more replies can be posted.