• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Three Submit buttons in the same row?

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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".
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
vaibhav punekar
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ramneek,
I got your point,that means I ll have to use Javascript.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please do not post the same message in multiple forums.
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


 
What's brown and sticky? ... a stick. Or a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic