Multiple submit buttons with form validation
This is a very simple example of how to code a form to allow redirection to any of 3 sites depending on which button the user presses, but only after the form validates properly.
In this example, at least one of the checkboxes must be checked before the redirection buttons at the bottom actually send the user to the alternate page or script. If you have text fields or whatever on your form, your validate function will be more complicated. For instance, you might have:
To make this code snippet work, you must add:
a. 3 real destinations or action routes (identified by action1.html, action2.cgi, and action3.html in my code)
b. 3 button images corresponding to:
submit1_icon.jpg, submit2_icon.jpg, submit3_icon.jpg
in your /images directory.
Then just copy it and paste it into test.html or whatever and browse to it. Voila!
Select All Code
|
|
|
Useful Links

|
|