Using the jQuery plugin found here:
http://docs.jquery.com/Plugins/Validation
I have a form, that when certain checkboxes are selected, additional fields are shown to the user. I would like to make these fields required when they click the checkbox, and unrequired if they unselect it.
Is there a way to dynamically set requirements for elements?
I think simplest approach is to attach the “required” class using jquery to these elements on click.
http://api.jquery.com/addClass/