Compare 2 Textboxes Not Working with Latest jQuery

I have a form that requires the user to enter their email address twice to ensure they enter it correctly. jQuery 1.9.0 has caused the below code to stop working, can someone please help with the update?


<script type="text/javascript">
 jQuery(function(){
        $("#submit").click(function(){
        $(".error").hide();
        var hasError = false;
        var emailadrVal = $("#emailadr").val();
        var checkVal = $("#emailadr-check").val();

	  if(!  emailadrVal.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z.]{2,5}$/g) ){
		alert('Please enter a valid email address.');
            hasError = true;
		}
	
       	if (emailadrVal != checkVal ) {
            //$('#emailadr-error').html("Email addresses do not match.");
			alert("Email addresses do not match. Please change.");
            hasError = true;
        }

if(hasError == true) {return false;}
    });
});


$(document).ready(function(){
      $('#emailadr-check').bind("cut copy paste",function(e) {
          e.preventDefault();
      });
    });	
</script>


The above code works fine with 1.3.2.

THANKS!!

Hi,

There’s nothing there that I can see that should be causing an error.
Can you post the HTML that goes with that jQuery (i.e. a short demo so that I can recreate your problem on my PC).