Yes.  The submit() still needs to be called on the appropriate form object.

Steven

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
=john=
Sent: Monday, July 17, 2000 3:04 PM
To: [EMAIL PROTECTED]
Subject: Re: question about how to use one form to submit to more than
oneservlet


Would this actually submit the form, or just set the ACTION attribute...

Wouldn't you need to add the following line of code AFTER... like

onClick="this.form.action='/ServletB'; this.form.submit();"

just thinking out loud

john haro

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Peter
Legowski
Sent: Monday, July 17, 2000 2:46 PM
To: [EMAIL PROTECTED]
Subject: Re: question about how to use one form to submit to more than
one servlet


Liz,

Try this instead: onClick="this.form.action='/ServletB';"
It should work for Netscape, & IE 4 and above.

Regards,
Peter Legowski

At 03:05 PM 7/17/00 -0400, you wrote:
>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

Peter Legowski
Unisys NASA Goddard Operations
[EMAIL PROTECTED]
301 286 3910

___________________________________________________________________________
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

___________________________________________________________________________
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

___________________________________________________________________________
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

Reply via email to