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".
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.
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.
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.
Post by:autobot
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