jQuery validate custom messages not working -


i unable custom error messages working jquery validation plugin. i'm using jquery 1.7.2 , jquery validation plugin 1.9.0.

my form simple:

<form id="registrationform">   <label for="rid">user id</label><br/>   <input id="rid" type="text" class="required"/><br/>   <label for="remail">email</label><br/>   <input id="remail" type="text" class="required email"/> </form> 

my javascript simple:

$(document).ready(function() {     $("#registrationform").validate({         rules: {             rid : {                 required : true             },             remail: {                 required : true,                 email : true             }         },         messages: {             rid : {                 required : "id can not empty"             },             remail: {                 required: "email can not empty",                 email : "enter valid email"             }         }     }); }); 

as crazy sounds, resolved adding name attribute each of input controls.

<form id="registrationform">   <label for="rid">user id</label><br/>   <input id="rid" name="rid" type="text" class="required"/><br/>   <label for="remail">email</label><br/>   <input id="remail" name="remail" type="text" class="required email"/> </form> 

here jsfiddle prove out.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -