can a form have

D

diablo

Hi

Can a form have multiple submit buttons that send it to different pages.

so if i press submitA it goes to pageA.asp
if i ress submitB it goes to pageB.asp

Thanks

D
 
M

Mark Parnell

Previously in alt.html said:
Can a form have multiple submit buttons that send it to different pages.

so if i press submitA it goes to pageA.asp
if i ress submitB it goes to pageB.asp

Yes. Just set your script that processes the form to send the user to
the appropriate page, based on which submit button was pressed.
 
T

Toby Inkster

diablo said:
Can a form have multiple submit buttons that send it to different pages.

so if i press submitA it goes to pageA.asp
if i ress submitB it goes to pageB.asp

No. But what you *can* do is submit the form to one single page that
checks to see what button was pressed and then redirects the user to
pageA.asp or pageB.asp.
 
N

Noozer

diablo said:
Hi

Can a form have multiple submit buttons that send it to different pages.

so if i press submitA it goes to pageA.asp
if i ress submitB it goes to pageB.asp

No. Only one "SUBMIT" button per form.

You CAN use scripting to alter the behaviour of a form though. Create
multiple buttons with an ONCLICK event in each that does the modification.
 
J

Jonathan N. Little

Noozer wrote:

No. Only one "SUBMIT" button per form.
<snip>
Ah no, you can have more that one submit button to a form, it become and
array element just like any other form field in a form with the same
name attribute.

Yes, you cannot change a form's action by which submit button was press
without client-side scripting, but as Toby suggests a common receiving
cgi scripted page can either redirect or adjust its processing based
upon the value of the specific submit button clicked.
 
N

NSDesign

Can a form have multiple submit buttons that send it to different pages.
so if i press submitA it goes to pageA.asp
if i ress submitB it goes to pageB.asp

Thanks

You might want to have a browse of the www.irt.org site specifically:
http://www.irt.org/script/form.htm
(scroll down to the "Changing the Action Property and using several Submit
Buttons" section)...

Should give you some actual working code to help you on your way :)

Cheers
Gary
---------------------------
NSDesign Internet Solutions
web: www.nsdesign.co.uk
support: www.nsdesign.info
Connection Packages: www.SurfMad.com
Domain Registration: www.DomainMad.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top