views:

36

answers:

1

I am using jQuery validation plugin for form validation. The problem I am facing is when I have inline labels..

For Example:

<input type="text" name="myinput" value="Enter your ....">

This is the sample case where validation is failing because the 'value' is set for input field. Is there any workaround? How do I ignore default/label values?

+1  A: 

I think you should make/add a method for that..

jQuery.validator.addMethod("exception", function(value, element) { 
  return this.optional(element) || value == "Enter your ...."; 
}, "message if bad");

then use exception : true...

more on addMethod()

Reigel