Reputation: 1241
How can I ignore title attribute to show error message in jquery validator plugin. Because i am using that title to show tooltip not for error message.
plugin initialization
$('#participantform').validate();
form element to validate
<input name="o_phone_cnt" class="inputtextie required digits" title="Country Code" style="width:25px" type="text" minlength="1" size="3" maxlength="3"/>
on button click
$('#sendmail_ppnt').button().click(function(){
$('#participantform').submit();
});
at the validation time it showing error message as required, but after adding the title to the input:text element it is showing Country Code as error message.
how to configure validator plugin to ignore title attribute to show error message.
Upvotes: 2
Views: 3358
Reputation: 262919
You can pass the ignoreTitle option to validate()
:
$("#participantform").validate({
ignoreTitle: true
});
In passing, note that the documentation says (emphasis mine):
Set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compatibility, the message-from-title is likely to be completely removed in a future release.
So, chances are you won't have to anything to obtain the behavior that you want with future releases of the plugin.
Upvotes: 6