• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java Script To Handle Multiple Buttons In A Form

 
eshu khare
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am beginner for java.Can you please provide me some hint on how to write a java script to handle multiple buttons for a single form.The Details are as follows :-
My current application is struts-spring-hibernate based.I have a page which has four different buttons and for each buttons I have formed four separate action class though the form bean is unique.Now I want to call all four different action on-click to the respective buttons,but not getting any proper idea for the java script have searched out it online,not seeking the whole code just need some help on it,if could possibly done.
 
Romit Bose
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
how about writing a javascript function for each button...(or may be we can club all the options for all the button through an if else block). Lets say the form name is myDocument that you want to submit.


[ December 22, 2008: Message edited by: Romit Bose ]
 
eshu khare
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Romit,It is done.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you could have coded your backend to react on the name of the button that was submitted to the page. Disable JavaScript and see how your form works with the solution you have now.

Eric
 
eshu khare
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric Pascarello ,
can you be please little descriptive,can provide some hint as per to the way you are saying.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic