Multiple buttons on form

M

Matt

How can I implement multiple buttons for a form like -
submit, cancel, logout etc.
Thanks.
Matt
 
C

Curt_C [MVP]

few ways... what I used to do is use the onClick to change the ACTION of the
FORM tag, then submit. You need to use TYPE=BUTTON instead of TYPE=SUBMIT
though....
 
M

Matt

Ok I have following code for my submit button :
<input type="image" src="submitbtn.png" border="0">
and follwoing code for my form submit :
<form name="form1" method="post" action="test1.asp">

Now I want to have both submit and cancel buttons
something like
<input type="image" src="submitbtn.png" border="0">
<input type="image" src="cacelbtn.png" border="0">
so that when submit is clicked it goes to test1.asp as
normal but when cancel is clicked it should go to
test2.asp.

Matt.
 
R

Ray at

To change the action of your form, you'd need to use client side code.
Something like:

<input type="image" src="cancelbtn.png"
onclick="this.form.action='test2.asp'">

Give that a try, and if that doesn't work, try inquiring in a client-side
scripting group such as .scripting.jscript or one of the non-MS javascript
groups.

Ray at work
 
M

Matt

thanks ray .. it worked.
-----Original Message-----
To change the action of your form, you'd need to use client side code.
Something like:

<input type="image" src="cancelbtn.png"
onclick="this.form.action='test2.asp'">

Give that a try, and if that doesn't work, try inquiring in a client-side
scripting group such as .scripting.jscript or one of the non-MS javascript
groups.

Ray at work




.
 

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

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top