I have a form with two sets of fields:
- "Contact information" (17 fields)
- "Company information" (5 fields)
There is a radio with the question "Do you have a company?" that is related to the company information. If the radio is "Yes", the company fields must be filled and validated. If the radio is "No", the company fields should be ignored.
I'm not sure about the best way to manage this problem.
By switching the attribute disabled of the company fields according to the state of the radio button and excluding all the disabled fields in the parsley option
$('#adminForm').parsley({excluded: '[disabled]'});
With two
data-parsley-group
and a validation of one or two blocks according to the state of the radio button
I'm trying to do it with an example on jsfiddle (but without success).