You should probably have the button of choice "selected" by default;
Otherwise I think you're out of luck unless you do some ugly hard-coding to
check for it's non-existence (from the form) & set up a null string.

-----Original Message-----
From: Thomas To [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 16, 1999 1:54 PM
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

Reply via email to