Join Bytes! wrote:[color=blue]
> I'm trying to set up a simple "change your password" form. I've got an
> AJAX process that is checking the new password the user enters against
> their current password to make sure they're changing it. This function
> is firing via the password field's onBlur event handler.[/color]
If the user has javascript disabled, what happens then? Do you do any
server-side validation?
[color=blue]
> I want to do some other form validation using the form's onSubmit
> handler (onSubmit="return validateForm();", and if all those conditions
> are met, the form submits.
>
> Problem is, if focus is on that password field and the user attempts to
> click the submit button, the onBlur event fires, and after that,
> nothing happens. The flow seems to be interrupted - I get no further
> activity indicating the click happened. No onFocus for the submit
> button, no onClick for that button, no onSubmit events will fire, and
> the form does not submit.
>
> How do I continue the process beyond that onBlur function if the user
> is trying to click the submit button?[/color]
Here's a scenario, let's just say that the server is under heavy
traffic, when the user submits the form, will your "AJAX" request come
back fast enough? Instead, I would say to keep your current validation
done through the onsubmit event handler and do the password checking on
the server-side. An even more plus is to do form validation on the
server-side as well, in case the user has turned off javascript.