The follow is an example:
--begin
<html>
<%@ page language="java"%>
<script language="JavaScript">
<!--
function display()
{
 var ftest = document.test;
 var len = ftest.elements.length;
 var i = 0;
 var str = "You chose ";
 for(i = 0 ; i < len; i++)
 {
  if(ftest.elements[i].name == "test")
  {
   if(ftest.elements[i].checked)
   {
    str += ftest.elements[i].value;
    str += " ";
   }
  }
 }
 alert(str);
}
//-->
</script>
<form name="test">
<input type="checkbox" name="test" value="aaa">aaa:
<input type="checkbox" name="test" value="bbb">bbb:
<input type="checkbox" name="test" value="ccc">ccc:
<input type="checkbox" name="test" value="ddd">ddd:
<input type="button" name="ok" value="test" onClick="javascript:display();">
</form>
</html>
--end

If you submit the page to another page that get the checkbox info, try
request.getParameter("test") in that page.

xgh



----- Original Message -----
From: Biren Patnaik
To: [EMAIL PROTECTED]
Sent: Wednesday, June 07, 2000 08:06 PM
Subject: How to access data from multiple selection of CheckBoxes


Hi,
Can anyone please suggest me how to generate data from multiple selection
of Check Boxes.
I m describing my problems as below.
I have got one List Boxes.There are 4 items in List Boxes.They are all
Numeric.They are 1997,1998,1999,2000 all are values for Year.
I have 4 Check Boxes,They are D1,D2,D3,D4.D1 is a column name of table
tab1,Like that D2 is a column name of table tab2,like of D3 and D4.
year is one of the column name of tab1,tab2,tab3 and tab4 table.
My problem is If I select 1997 from List Boxes and select D1,D2,D3 from
Check Boxes,I should get records generated from tab1,tab2,tab3 for the
year 1997
I will appreciate for any kinds of solution.
Thanks in advance
Biren

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to