• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple buttons

 
krishna prasad gunasekaran
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai, how to assign servlets to buttons in case of multiple buttons.

have a nice day.

krishna prasad
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean set the action to different locations.

Personally I would have the server determine what to do and not clientside code, but...

&#nclick="document.formName.action='foo'"

Eric
 
krishna prasad gunasekaran
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, but i don't understand what you mean by,

'I would have the server determine what to do and not clientside code'.

krishna prasad
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I would not advise using a single URL for multiple actions.

You didn't give much context on your issue. If the buttons are submit buttons in a form, you can use an onsubmit handler to change out the action of the form just before submission. If not, then using disparate onclick handlers will let each button do whatever they want.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic