Hi,

try:
<input type="SUBMIT" NAME="btn" VALUE="First button">
<input type="SUBMIT" NAME="btn" VALUE="Second button">

then you can check by
String button = (String)req.getParameter("btn");

if (button.equals("First button"))
///////it's the first
else it's the second

hope helpful
yang




> >I'm developing a mini applications server for internal purposes, and now
>I'm
> >facing with a problem: suppose I have the following html code:
> >
> ><form action=/servlet/.....>
> ><input type="SUBMIT" NAME="btn_1" VALUE="First button">
> ><input type="SUBMIT" NAME="btn_2" VALUE="Second button">
> ></form>
> >
> >How do I know when user press the 1st or the 2nd button?
>I've never used this, so i don't know if it works, but i saw it on a
>webpage somewhere. Try getting the value of the parameter "action".
>
> >
> >Thanks in advanced
> >
> >
> >--
> >
> > saludos,
> > jmiguel
> >
> > Virtual Software,
> > http://www.virtualsw.es/
> > ICQ 13550064
> >
> >___________________________________________________________________________
> >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

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.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

Reply via email to