You can use Javascript to set the action of the form, and then submit it
...
function submitForm(actionUrl){
// document.forms[j].reset();
if (isMS){
formStuff = eval ("document."+ currentForm);
}else{
// for netscape if you are using layers eval your current layer
}
formStuff.action = actionUrl;
formStuff.submit();
}
...
<form action="/servlet/ServletName" method="post">
...
<input type="button" name="action1" value="continue"
onClick="submitForm('/servlet/A');">
<input type="button" name="action2" value="finish"
onClick="submitForm('/servlet/B');">
</form>
...
Or have 1 servlet to accept calls from the form and have it route the action
requested to the appropriate object (see Jon's DASH on www.workingdogs.com
for a good example of that).
I only use the JS stuff for working with Forms on layers in DHTML, and use
the routing style for everything else (including handling the JS version).
The JS one I use so I can throw other forms on layers and not care about
syncing the action/submit as they'll get set by the servlet. That way I can
move the servlet called to any packahe combination, and not worry about the
layered forms.
Thor HW
> -----Original Message-----
> From: Oksana Kochubey [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 13, 1999 2:17 PM
> To: [EMAIL PROTECTED]
> Subject: Servlets and HTML forms
>
>
> Hi everyone,
>
> I have a question. I have two submit buttons on my HTML form which need to
> envoke two different servlets. How can I write two <form action .. >
> statements in my HTML to differentiate between two actions?
>
> <form action="/servlet/ServletName" method="post"> // ????
>
> <td WIDTH=10% align=right><input type="submit" taborder="24" tabindex="24"
> title="CONTINUE" name="CONTINUE" value="CONTINUE"></td>
>
> <td WIDTH=10% align=left><input type="submit" taborder="24" tabindex="24"
> title="FINISH" name="FINISH" value="FINISH"></td>
>
>
>
> Thanks,
>
> Oksana
>
>
___________________________________________________________________________
> 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