Hi there, i am using the Jquery validation plugin, sourced from here.
It is function well for required fields, email etc, however I would like to set up some specific validation rules for certain form fields. For example, I have a select form field which contains the following options...
<select name="salutation" id="salutation" class="conditional">
<option value="0">--- Please Select ---</option>
<option value="1">--- MR ---</option>
<option value="2">--- MRS ---</option>
</select>
I would then like to use the validation plugin to display a message if a salutation has not been selected..I.E
$("#userForm").validate({
// Validate Fields On Blur
onfocusout: function(element){
this.element(element);
},
// Set Specific Rules for Validation
rules:{
salutation: {
NEQ:0
}
},
messages:{
salutation: {
NEQ: "please select a salutation"
}
}
});
Wondering if anyone had any ideas on how to customize the plugin to allow such things. Many thanks