asp.net mvc - livequery not always live when used with jquery.validate -


i use jquerylive plugin add additional css classes .field-validation-error class this:

$(".field-validation-error").livequery(function () {      $(this).addclass('ui-state-error ui-corner-all');  }); 

when spans class generated jquery.validate above code works, @ 2nd validation doesn't.

here live link: http://mrgsp.md:8080/awesome/person click on create after click save validation messages , click again on save

why not hook function same event triggers validate()?

update

i read other comments , saw using xval, read bit on jquery.validate well. jquery.validate ties in many events , registering on event handlers messy. reason livequery works first time labels generated if don't exist creation event makes function run, everytime after label hidden/shown doesn't triggered again jquery.validate's showlabel function resets classes.

the ideal place in xval making 1 small change in xval.jquery.validate.js file. in _ensureformismarkedforvalidation method lines:

ensureformismarkedforvalidation: function(formelement, options) {         if (!formelement.data("ismarkedforvalidation")) {             formelement.data("ismarkedforvalidation", true);             var validationoptions = {                 errorclass: "field-validation-error", 

all should need change errorclass to:

errorclass: "field-validation-error ui-state-error ui-corner-all", 

this because xval doing setting of validate plugin.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -