0

Working with jquery.validate.js (jQuery Validation Plugin - v1.10.0 - 9/7/2012) i found the 'onkeypress' validation of email fields too obtrusive - this answer seems like it fit my needs perfectly. I no longer see the validation message while typing.

However - on form submission I'm getting an error against jquery:

dispatch(event=Object { originalEvent=Event change, type="change", jquery-1.9.1.js (line 3074)

Community
  • 1
  • 1
justSteve
  • 5,444
  • 19
  • 72
  • 137
  • try `$("[data-val-email]").blur(function () { setTimeout(function () { $("#Email").focus(); }, 50) });` – Arun P Johny Feb 13 '14 at 07:18
  • I appreciate the quick feedback - unfortunately it came in while I was revising my original question. I had thought the approach was giving me the behavior I wanted but didn't see the firebug report of error. With the original code only (not my added line) I'm getting the error shown in my edited question on _both valid and invalid field submissions. – justSteve Feb 13 '14 at 07:55
  • There is no such thing as `onkeypress` in jQuery Validate. I think you want `onkeyup`. Secondly, why are you using version 1.10.0 of the plugin with jQuery 1.9.1? The latest version of the plugin tested with jQuery 1.9 is 1.11.1. – Sparky Feb 13 '14 at 15:52

1 Answers1

1

Just add onkeyup : false to your jQuery.validation options, then it wont trigger validate when you input anything.

   $('#your_form_id').validate({
       onkeyup: false,
       rules : { 
           email : {email : true} 
       }
    });
NewBee
  • 1,331
  • 12
  • 13
  • Rather than just pasting a random bunch of code, explain what you did and why. That way, the OP and any future readers with the same problem can actually learn something from your answer, rather than just copy/pasting it and asking the same question again tomorrow. – Oldskool May 17 '16 at 08:48