Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to save value of button pressed?

 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have two submit buttons on a JSP and want to be able to set the particular button the was presses and display it on the next page.
This is what have so far:

<html:submit value="Modify" disabled="true" property="Modify">Modify</html:submit>
<html:submit value="Add" disabled="false" property="Add">Add New</html:submit>


I tried creating form bean attributes namded "modify" and "add", but those do not seem to be getting set with the value of the button presses.
Any ideas?
 
Neela Sathesh
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Why can't you use the same property for both the Button.Then you have a property in the form in which you will be able to get the value of the form.
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh good idea. That worked. Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic