Link to home
Start Free TrialLog in
Avatar of jduawa
jduawa

asked on

jQuery Validate and depends

I am using jQuery validate to validate a form.  I have mulitple fields that are required if a select box is a certain value.
do i have to do this (see code)
employee_firstname: {
						required: {
							depends: function(element){
								if($("#person_responsible").val()=='6'){
									return true;
								} else {
									return false;	
								}
							}
						}
					}

Open in new window


for eac of the dependent fileds or is there a way to say all these other fields are required if the select is a certain value
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Justin Mathews
Justin Mathews

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial