Disable "required" with Javascript if one field has data
-
I have two fields. Field A and Field B.
I want AT LEAST one field to be required. So, if Field A has data and Field B doesn’t, great. If Field B has data and Field A doesn’t, great. If both have data, great. But at least one should be required.
So, I set A as required and B as optional. Then, with javascript, I said if B has data, don’t require A. I removed all the classes on A that should control the required/validation.
Great in theory.
But Contact form 7 continues to throw validation errors on Field A, even when all classes are remove – even when the name is changed.
How can I get around this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Disable "required" with Javascript if one field has data’ is closed to new replies.