• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple submit buttons on html forms

 
marcosss kant
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am building an application that has only one html form, but three submit buttons. I know that forms can only have one possible action, so does anybody know how to have the three buttons? Right now, I have three forms (one for each button) that take exactly the same information, so if you don�t know how to have multiple buttons, do you know how to pass information from one form to another in the same html page?

Thanks.
[ November 14, 2005: Message edited by: Bear Bibeault ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34860
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marcosss,
You can use a javascript function to change the form's action when each button is clicked.

Since this question isn't about the IDE in particular, I'll move it to our JSP forum. Welcome to JavaRanch!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The value of the button that was clicked will be sent along with the other form fields.
The value of the other button's won't be sent.

This means that you can branch your code on the server and perform different actions according to which button was pressed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic