I’m trying to only validate a textfield when a user selects yes. If the option is no then the textfield should not be validated(and it’s hidden also).
The validation is done with the validate plugin from http://www.bassistance.de
Anyone can help me out? I made a fiddle to clarify.
Have a look at the
dependsoption in the validate API. Something akin to this should work for you:Here’s an updated fiddle with it working: http://jsfiddle.net/PaTJ4/31/
I’ve also taken the liberty of tidying up your code a little.