Date:  07/11/2006 01:49:15 PM Msg ID:  003042
From:  FoxWeb Support Thread:  003041
Subject:  Re: Validate Using AJAX Part 2
If you want to prevent the form from being submitted, you can add JavaScript code to the form's onSubmit event.  The code should return true, unless the password has already been authenticated, in which case it should return false.

FoxWeb Support Team
support@foxweb.com email

Sent by Jeff Grippe on 07/11/2006 07:46:55 AM:
I have a form with a password text field and a submit button.
 
Thanks to your help I have figured out how to validate the password using AJAX without submitting the form.
 
I also figured out how to have the submit button disabled with entry of the correct password making it enabled (DISABLED=false).
 
My last problem is that even with the submit button disabled, the enter key from the password text box tries to submit the form. The onblur code from the text box executes after the onsubmit code from the form.
 
The result is that the user sees an "incorrect password" message even though the password has been entered and is correct. Then the password gets validated and the form is submitted.
 
Is there a way to prevent the ENTER key from submitting the form?
 
Thanks.