The way I handled this was to create boolean variables which represent
the data coming from check box's and pre-assign them all to false. Then
when a particular checkbox is checked, HTML passes the value of true
via the getParameter() and then assign the variable to true. If the
boolean variable is false you know that know one has checked that
particular box, and vise versa if it is checked.
Brad
> -----Original Message-----
> From: Thomas To [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, April 16, 1999 11:54 AM
> To: [EMAIL PROTECTED]
> Subject: checkbox in form
>
> Hi all,
>
> I'm writing a servlet to get input values from an HTML form and put
> them
> into the database. I use both input type="text" and input
> type="checkbox". In the servlet makes call to
> ServletRequest.getParameterNames() and ServletRequest.getParameter()
> to
> retrieve all the parameters and their values. I realize that for all
> text type, if nothing is put in, the parameter name will be return and
> the value is an empty string. However, for checkbox type, if all
> checkboxes are unchecked, getParameterNames() will not even return the
> parameter name. Is this normal? Is there any way that
> getParameterNames() will return the parameter name with empty string
> like the text type?
>
> Can anyone give me some info on this?
>
> Thanks.
>
> - Thomas -
>
> ______________________________________________________________________
> _____
> 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