i'm using the validator plugin from
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
i'd like to know if it is possible to use it in conjunction w/ onblur/onfocus events. for instance, i don't want to use a label tag to describe the text input. i'd like to have that be preset as the input value and then on blur, it will go away.
can i get this plugin to verify that the submitted info does NOT equal the original value... (ie... "First Name")
i've tried the addmethod in the API but i'm not sure how to implement it properly
- jQuery.validator.addMethod("myname", function(value, element, params) {
- return this.optional(element) || value != "First Name";
- }, "Please enter your first name");
here is my input:
- <input id="fname" class="textInput myname required" minlength="2" type="text" title="First Name" name="First Name" value="First Name" onfocus="if(this.value == 'First Name') { this.value = '' };" onblur="if(this.value == '') { this.value = 'First Name' };" />