Hi,
I have an HTML form on a JSP which has the user select one or more items using
checkboxes. I have two buttons, say ButtonA and ButtonB. If the user clicks ButtonA, I
want to post to ServletA. If the user clicks ButtonB, I want to post to ServletB.
The problem is, I have to specify the form action before knowing which button the user
will click. I've tried a couple of things that haven't worked. One is using something
like this for ButtonB (with the form action being ServletA):
<INPUT Type=BUTTON name=buttonB value="buttonB"
onClick="JavaScript:location.href='/ServletB;'">
And the result is that no parameters (namely, the selected checkbox items) are sent to
ServletB.
The other thing I've tried is making ButtonB's input type SUBMIT, so it submits to
ServletA, but using the RequestDispatcher to forward on to ServletB. What winds up
happening here is that it does go to ServletB, but actually continues back onto
ServletA (I assume because that's the form action.)
Any ideas?
thanks,
Liz Stanley
[EMAIL PROTECTED]
http://www.gymell.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html