I have a form that displays user groups ..and two buttons - one to Add new user groups and the other to delete existing user groups.the portion that displays the user groups on the form is same for both these actions. on clicking on these buttons each calls a different jsp file to do the respective task ..now my question is though i have made both the buttons a submit button how to have two different action attributes on the same form..have any one of u encountered such a need and what are the ways of going abt. it ? I dont want to make it a hyperlink... Pls send me the code and any links ..pls help ..it is very urgent thanks all Yogesh
[This message has been edited by Peter den Haan (edited May 18, 2001).]
Hi Yogesh, you can put each submit into a separate form-tag, e.g.: .. <form name="firstaction" action="firstaction" method=post> <input type=submit value="firstactionvalue"> </form> .. <form name="secondaction" action="secondaction" method=post> <input type=submit value="secondactionvalue" > </form> ..
But Frank he has to make compromise on the performance,having two form is the ideal solution for his question,what raj suggessted is not for two submit button ,thats for two ordinary buttons..... cheers. gv
Joined: Jan 07, 1999
You have to be very careful if you use multiple forms rather than multiple submit buttons in one form. Different browsers lay out forms in very different ways, and if you would like to have both buttons on the same line of the page, then it may not be possible with multiple forms. Make sure you test your look-and feel with at least IE, Netscape 4, Netscape 6 and Opera and don't assume that because one browser does what you expect they all will. Adding a servlet controller shouldn't have a significant performance impact anyway. The Servlet API explicitly provides a way to forward directly to a local JSP or servlet with no extra network traffic.
Joined: Apr 09, 2001