Prevent validation on hidden required fields
-
Hi,
How can I prevent validation on required fields which have been hidden?
Suppose I have:
[radio field1 “A” “B”]
Selecting Option B unhides a <div> section using JavaScript. Selecting Option A hides the <div> section.
The <div> section contains required fields e.g. another set of radio buttons or a required text field.
On selecting Option B, the form should validate the previously hidden fields as normal.
On selecting Option A, those fields remain hidden and should not be validated and should not prevent the form being submitted.
Unfortunately, that’s not the way validation currently seems to work. The form tries to validate all fields whether they are hidden or not and prevents the form being submitted
I would be grateful for any tips on how to solve this issue.
Many thanks!
- The topic ‘Prevent validation on hidden required fields’ is closed to new replies.