I want two buttons on a page, one for "search refine", one for "submit", how to do ?
Artemesia Lakener
Ranch Hand
Joined: Jun 21, 2005
Posts: 162
posted
0
On one JSP page, I have a very long list of items. So I want a "search" button (and a search text field of course) to filter information, when user hits this button the page will be refreshed and display the filter item list. When user hits the "submit" button, it should directly go to next functional page without doing any further "search".
But it seems a FORM can only handle one button, how do I accomplish this two tasks on one JSP page using struts ?
Jason Menard
Sheriff
Joined: Nov 09, 2000
Posts: 6450
posted
0
Originally posted by Artemesia Lakener: But it seems a FORM can only handle one button, how do I accomplish this two tasks on one JSP page using struts ?
This is a good question and one that is frequently asked. I suggest searching this forum as there are many threads which address this issue.
A form can have multiple buttons. There is more than one way to handle multiple buttons. One is to check in the Action class which button was selected (and there are multiple tricks for determining this). Another way is to use DispatchActions.
As Jason said, there are plenty of resources on that topic here to search through. I hope you can use key words from my post to refine your search. If you have trouble let us know.