jquery dynamic validation rule ignoring message -


using jquery validation plugin, have composed following, find default validation message displayed rather custom message (i have used constant in other validations, know works!). missing?

$("#pageform").validate(); $("input[id^=displayname]").each(function() {     $(this).rules("add", {         maxlength: aghostmobileadmin_validation.constants.displaynamemaxlength,         messages: {             maxlength: aghostmobileadmin_validation.format.displayname         }     }); }); $("input[id^=navigationlabel]").each(function() {     $(this).rules("add", {         maxlength: aghostmobileadmin_validation.constants.navigationlabelmaxlength,         messages: {             maxlength: aghostmobileadmin_validation.format.navigationlabel         }     }); }); 

try this..

messages: {             maxlength: aghostmobileadmin_validation.format.navigationlabel         } 

to

messages: {             maxlength: aghostmobileadmin_validation.format.navigationlabel         } 

note maxlenth changed maxlength (l become l)

so complete code should

$("#pageform").validate(); $("input[id^=displayname]").each(function() {     $(this).rules("add", {         maxlength: aghostmobileadmin_validation.constants.displaynamemaxlength,         messages: {             maxlength: aghostmobileadmin_validation.format.displayname         }     }); }); $("input[id^=navigationlabel]").each(function() {     $(this).rules("add", {         maxlength: aghostmobileadmin_validation.constants.navigationlabelmaxlength,         messages: {             maxlength: aghostmobileadmin_validation.format.navigationlabel         }     }); }); 

here working code

http://jsfiddle.net/cnrd3/


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -