Hi guys,
This is the scenario. I have a form, with 4 Submit buttons at the bottom, 3 of them (which all work) just send the user to the same page (as the buttons are on) on click (set in the form tag with action). The other Submit button, I would like it to send the form details (using post) to a different page altogether. Is this possible?
I am presuming there is a simple way of doing this using JavaScript, but I have very, very little experience with JavaScript.
Any help would be much appreciated.
TIA.
Using Multiple Form Submit Buttons [SOLVED]
Moderator: General Moderators
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Using Multiple Form Submit Buttons [SOLVED]
Last edited by jayshields on Tue Sep 20, 2005 9:50 am, edited 1 time in total.
-
RobertPaul
- Forum Contributor
- Posts: 122
- Joined: Sun Sep 18, 2005 8:54 pm
- Location: OCNY
Well, what you can do is give the last Submit button a different id/name, i.e.
Then on whatever page the form's action is set for, check for $_GET/POST['different'] == "whatever" and redirect accordingly.
It's entirely possible that there's a better way to do this, but this is all I can think of.
Code: Select all
<input type="submit" id="different" name="different" value="whatever" />It's entirely possible that there's a better way to do this, but this is all I can think of.
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
Last Submit Button should be like following code
Code: Select all
<input type="submit" value="Different Submit" onclick="this.form.action='http://new.loc.com/'">- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England