I have had no luck getting this or the other (requiredIf) validators to work, Example:
Radio group "working":
- Option one (value: 1)
- Option two (value: 2)
Radio group "work"
- Option a
- Option b
What I want is for the "work" radio group to be required only when "working" radio has Option two selected (value: 2). Currently if I have option one selected work isn't required, which is great. But if I have Option two selected work is required, problem is it always complains that "work" is required even when I have selected Option a, or Option b within it.
I have set up formit with:
- &customValidators=`condRequired`
- &validate=`work:condRequired=^working|2^`
(I had to use ^ rather than ` in the validate call because ` are no longer allowed in formit validate calls)
I have tried with all 3 versions of the condRequired snippet in this thread. Any help would be greatly appreciated. I have the exact same problem with the requiredIf custom validator located at
https://gist.github.com/bertoost/4000623. I'm not a PHP guy and really need this required if kind of validation. Wish formit had this built in.