Forums Register Login

Three Submit buttons in the same row?

+Pie Number of slices to send: Send
Hi guys,
I m invoking a servlet thro HTML submit button that outputs the detailed Reg form.It has three "submit" buttons in the end.Each has different action.I wish to place them in the same row of the table.How do I achieve this?
As far as I know there can be only one action.Shall I take three diff tables(1 row 1 column) having three forms resp. each having diff action.Right now they are placed one below the other.
Three common buttons are "submit" "back" and "cancel".
+Pie Number of slices to send: Send
Hi vaibhav,
Just place the simple buttons instead of the submit buttons. Just call a function on onClick event of the button and pass the parameter 1,2 or 3 as action so that you can know which button is got pressed.
In the common function you can check which button got pressed and depending on that you can change the action and submit the form i.e
document.[formname].action="URL";
document.[formname].submit();
hope this will solve your problem.
bye.
+Pie Number of slices to send: Send
Thanks Ramneek,
I got your point,that means I ll have to use Javascript.
+Pie Number of slices to send: Send
couldnt you just have them all as submit buttons (only one will get pressed at a time.) and then check on the receiving page which one was pressed and do that action. then you dont need javascript.
+Pie Number of slices to send: Send
Please do not post the same message in multiple forums.
+Pie Number of slices to send: Send
I would not recommend this, since there is no real need for using JavaScript here and it limits the clients that can use your page. Simply use three submit buttons with different name attributes (i.e. '...name="cancel"', '...name="update"', ...) and check for the existence of these names in your processing JSP or Servlet.
The other part of your question seems to be more of an HTML issue. I am not an expert on this myself, but it sounds like using a table row with three cells, one for each submit button, should work.
-Mirko

Originally posted by vaibhav punekar:
Thanks Ramneek,
I got your point,that means I ll have to use Javascript.


There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 845 times.
Similar Threads
Processing Radio Buttons in a Form/Servlet
Which controller I have to use for a page having multiple submit buttons
Which controller I have to use for a page having multiple submit buttons
Can I have three buttons(same row) in the same form?
multiple submit buttons on html forms
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 01:11:30.