> 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?
The buttons show up as parameters in the servlets request.
If one or other of the two buttons will always be pressed,
you might find it easier to use the same name for the button
then you can do something like ...
String button = req.getParameter("btn");
if ( button.equals("First button") )
...
else if ( button.equals("Second button") )
...
Hope this helps.
+------------------------------------------------+
| Jill Stephenson - Tortuga Technologies Pty Ltd |
| |
| [EMAIL PROTECTED] |
| http://www.tortuga.com.au |
+------------------------------------------------+
___________________________________________________________________________
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