Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the default submit action for a form

Status
Not open for further replies.

GezH

Programmer
Aug 7, 2002
68
0
0
Hello.

I have a pretty normal form - a few textfields etc, except that there are two submit buttons. One goes back to the previous page (not javascript but a struts action) and the other goes to the next step.

If you have the cursor placed in any of the text fields and press return, the default action of the form seems to be the 'go back' button. I want the default action to be to go to the next step. Any ideas how I can set this in the form please?

Many thanks!
 
If there's no need for data to be posted back tho the server on the back button, you could use images instead. (and an input of type image for the submit button for consistancy)

Otherwise, you could get it to post to a server side script which can determine which button was pressed and proceed from there.

Either way is relatively simple.
 
Ignore my post its totally irrelevant.

Dans solution is probably the best way.
 
Yes, swapping the source order of the buttons did the trick, thankfully they still appeared in the correct order on the page.

Thanks guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top