jQuery Validate actually directly supports this, using dependency expressions.
All you need to do is change your validate options like this:
$('#myform').validate({
rules: {
fieldA: {
required:'#checkA:checked'
}
}
});
That’s it!
More Related Contents:
- jQuery Validate Plugin – How to create a simple custom rule?
- How to manually trigger validation with jQuery validate?
- jquery validate plugin on dynamic form inputs not working
- Dynamic jQuery Validate error messages with AddMethod based on the element
- jQuery Validation using the class instead of the name value
- JavaScript Detecting Valid Dates
- jQuery validate plugin on DIV
- jquery validate check at least one checkbox
- Best way to validate date string format via jQuery
- how to check if a form is valid programmatically using jQuery Validation Plugin
- Uncaught TypeError: Cannot read property ‘call’ of undefined
- Validate inputs that are not inside a form with jQuery Validation plugin [closed]
- Validate Dynamically Added Input fields
- Passing variable to function in javascript and jQuery
- Reloading a single div in an html page [closed]
- jQuery function to get all unique elements from an array?
- Uncaught TypeError: Cannot use ‘in’ operator to search for ‘length’ in
- Resetting a setTimeout
- How do I find the absolute position of an element using jQuery?
- How to check if any JavaScript event listeners/handlers attached to an element/document? [duplicate]
- Difference between onload() and $.ready?
- In jQuery, how do I get the value of a radio button when they all have the same name?
- Compress images on client side before uploading [closed]
- JavaScript: Know when an image is fully loaded
- Javascript to convert Markdown/Textile to HTML (and, ideally, back to Markdown/Textile)
- How can I use a variable in a jQuery attribute selector?
- jquery/javascript: function(e){…. what is e? why is it needed? what does it actually do/accomplish?
- Compare two date formats in javascript/jquery
- “Permission denied” with Internet Explorer and jQuery
- Jquery delay execution of script