Hi!

First solution would be to use a one Servlet only
and the submit buttons to has the same name.
Like this
<form action=Myservlet>
...


<input type="submit" name="submit" value="finish">
<input type="submit" name="submit" value="continue">

Than in the servlet check the value of the parameter "submit"

Second is to use to forms but than the buttons can't be one beside the other
only one below other.

Third is to use JavaScript and not use submit buttons only ordinary ones
<input type="button" name="button1" value="Continue"
onClick="callservlet(1)">
<input type="button" name="button2" value="Finish" onClick="callservlet(2)">

<script language="JavaScript">
function callservlet(i){
 if (i==1) document.forms[0].action="http://www.somewhere.com/MySerlvet1";
 else if (i==2)
document.forms[0].action="http://www.somewhere.com/MySerlvet2";

document.forms[0].submit();
}



Best wishes,
                    Andras






----- Original Message -----
From: Oksana Kochubey <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 13, 1999 9:16 PM
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

Reply via email to