Try this :

String[] checked_values = request.getParameterValues("html_check_box_name");

for (int i = 0; i < checked_values.length; i++)
{
   out.println(checked_values[i]);
}

Hope it help.




----- Original Message -----
From: "Luc Foisy" <[EMAIL PROTECTED]>
To: "JDJList" <[EMAIL PROTECTED]>
Sent: Sunday, June 16, 2002 7:38 AM
Subject: [jdjlist] SERvlets and Form data: checkbox



I am not having much luck with this

How do I get the value of a checkbox??

I am trying this:
if( request.getParameter("includeheader") != null &&
request.getParameter("includeheader").equalsIgnoreCase("yes"))

but that is obviously not working for me

I tried this:
for (java.util.Enumeration e = request.getParameterNames() ;
e.hasMoreElements() ;) {
         System.out.println(e.nextElement());
     }

and it didnt matter if the check box was selected or not, this did not
return a name



I am kinda looking for a quick response

To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to