Jquery email validation fire agian after fix -
when email address not valid working fine @ if. when go , put in valid email else should fire , clear error div not.
<script> $(document).ready(function(){ $("#email").blur(function (){ var emailreg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if (!emailreg.test(email.value)) { $("#theerrordivid").html('email address not valid!'); $('#email').css("background-color","red"); $('#email').focus(); } else { $("#theerrordivid").html = ""; } }) }); </script>
$("#theerrordivid").html = "";
should be
$("#theerrordivid").html("");
Comments
Post a Comment