submit vs. onSubmit Humbug I had a few questions about form verification. This is a good one from John Romero, who wants to replace the standard form button with one of his own design:
As per HTML documentation, a form can be validated prior to execution by using the onSubmit() method. The onSubmit() method should return a logical value which if true would execute the action.
If ValidateFields() returns a true, the form would go on to execute its action, ie:
As stated in documentation and according to my logic, once the user clicks on the image, it should trigger a form execute. The onSubmit() method should execute next and based on its "return" value, the form should execute its action.
Guess what!, this approach never ever reached the onSubmit() method.
Here's the sample code.
[Jump to Part 4]
Web Developer® Site Feedback
Copyright © 1999-2001
All rights reserved.