On Thu, Jan 7, 2010 at 11:04 AM, Andre Polykanine wrote:
> var validator=$("#myform").validate( { <snip> });
>
> $(document).keydown (function (e) {
>    if (e.ctrlKey && e.which==13) { validator.form(); }
> });
>
> then I'm trying to submit. If I do something wrong (for example, leave
> a required field blank) and press Ctrl+Enter, Validator gently tells
> me that yes, that field is required, go on and fill it in. But if I
> fill in the field and do everything correctly, pressing Ctrl+Enter
> gives absolutely nothing: no errors and no submit.

It's not submitting because you never tell it to. I would first try
replacing the call to validator.form() with $("#myform").submit(). I
would assume that does the validation check first. In case doing that
bypasses the validation, check the return value of validator.form()
and submit if it's successful, a la: if (validator.form())
$("#myform").submit();.

Nathan

Reply via email to