On Saturday, March 13, 1999 1:17 AM, SUH [SMTP:[EMAIL PROTECTED]] wrote:
>
> Hi,
>
> I'm writting Web pages contianing some checkboxes.
>
> But I can't verify which checkbox was selected:
>
> For example>>
> <input type="checkbox" name="male" value="ON">
> <input type="checkbox name="female" value="ON">
>
> Then
>
> A user will check one of checkboxes.
>
> In servlet
> ,
>
> req.getParameter("male");
> OR
> req.getParameter("female");
>
> These are not working. The statements always return "ON".
> I want to know which one was checked.
>
This looks to be something that should be a set of radio buttons rather then
checkboxes, i.e.
<input type="radio" name="sex" value="M">Male <input type="radio" name="sex"
value="F">Female
Then
if (req.GetParameter("sex").equals("M"))
...
else
...
Bob
___________________________________________________________________________
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