jquery.validation - how to ignore default values when validating mandatory fields -


i using jquery validation plugin validate registration form.

each text input field has instructions pre-filled values in input box

ex: text-input box id='name', default value set 'enter name'. have pasted below sample code:

<input type="text" id="name" value="enter name" onfocus="if(this.value == 'your name'){this.value = '';}" type="text" class="required" onblur="if(this.value == ''){this.value='your name';}" size="25" /> 

what need know how specify in validation rule such plugin throws required field error if input box contains either default message or empty values.

help appreciated.

i think better:

jquery.validator.addmethod("defaultinvalid", function(value, element)  {     return !(element.value == element.defaultvalue); }); 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -