JQuery Validation Plugin: Ensure Form Field is not a specific Value -
I am using jquery validation plugin, from which sourced.
This is a good job for required fields, email etc. However, I would like to set some specific verification rules for certain areas. For example, I have a select form field that includes the following options ...
& lt; Select the name = "Hello" id = "salutation" class = "conditional" & gt; & Lt; Option value = "0" & gt; --- Please select --- & lt; / Options & gt; & Lt; Option value = "1" & gt; --- MR --- & lt; / Options & gt; & Lt; Option value = "2" & gt; --- MRS --- & lt; / Options & gt; & Lt; / Select & gt;
Then I would like to use the verification plugin to display a message if no salute is selected ..
$ ("# userForm "). Validitude (Blur on Focus on valid field: function: Element) {this.element (element);}, // set specific rules for validation rules: {Hello: {NEQ: 0}}, Message: {Hello : {NEQ: "Please select a greeting"}}});
If anyone has any ideas about customizing the plugin to allow such things, think about it. Thank you very much
You can use this case
category : [1, 2]
Comments
Post a Comment