View Complete Thread | FoxWeb Forum Home
Date:    Msg ID:   
From:    Thread:   
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 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?