jquery validate showing previous errors for valid field -


just started using jquery validate , i'm getting multiple errors fields invalid. moved error container , can see errors still there after field corrected. end bunch of errors stacked on top of each other. see "current" errors.

you can see mean here: http://opiemedia.com/dev/lo/sv/varb/

this im using form validation

$(document).ready(function() {  $("#evalfrm").validate({     rules: {      name: {        required: true,        minlength: 2,      },      company: {        minlength: 2,      },      email: {        required: true,        email: true,      },      phone: {        required:true,        minlength: 7,      }    },    errorlabelcontainer: "#evalerr",    errorclass: "error label label-warning"   });  }); 

this html

<div class="span8 well" style="margin-left:0;">       <form id="evalfrm action="#" method="post" class="evalfrm" name="evalfrm">         <input name="oid" type="hidden" value="00d400000008j4n" />         <input name="returl" type="hidden" value="#" />         <input class="span6" id="name" name="name" placeholder="full name" type="text" />          <input class="span6" id="company" name="company" placeholder="company" type="text" />         <input class="span6" id="email" name="email" placeholder="email" type="email" />          <input class="span6" id="phone" name="phone" placeholder="phone" type="tel" />          <button class="btn btn-success span6 offset3" type="submit"onclick="_kmq.push(['record', 'request info form submission']);">evaluate </button>             </form>             <div id="evalerr"></div>           </div> 

thanks taking time me out!

i think have come across bug in library, problem have 3 classes in errorclass propery, if pass 2 classes works fine.

the bug in following line in errors() method

var errorclass = this.settings.errorclass.replace(" ", "."); 

it replaces 1 <space> . should have replaces instances.

demo: two classes works fine
demo: three classes not work

fix: if using local copy of validator.js file can fix changing line to

var errorclass = this.settings.errorclass.replace(/\s/g, "."); 

note: i'll try submit patch later in day


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -