Hi Berin, the example I gave last time is just an example. Now I know your
definite request. I provide the two files to you.
--file1.jsp begin
<html>
<%@ page language="java"%>
<form name="test" method="post" action="file2.jsp">
<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="submit" name="retrive" value="retrieve">
</form>
</html>
--file1.jsp end
--file2.jsp begin
<html>
<%@ page language="java"%>
<%! String str;%>
<%
str = request.getParameter("test");
%>
<%=str%>
</html>
--file2.jsp end
After creating the two files, invoke file1.jsp in your browse and check
the checkboxes you want, push the retrieve button then you will get the
result you expect. Analyse the string you get and then access the db
according to the analysis result. About the accessing to oracle, If you
want, I will give your another example.
Hope this helps. Any question, contact me.
xgh
----- Original Message -----
From: Biren Patnaik
To: [EMAIL PROTECTED]
Sent: Wednesday, June 07, 2000 11:04 PM
Subject: Re: How to access data from multiple selection of CheckBoxes
Hi xgh,
Thanx a lot for ur quick reply to my question.But ur solution did not help
me solving my problem.Can u please send me any examples of accessing data
from Oracle database by multiple selection of CheckBoxes.How can I retrive
data from multiple tables by selecting multiple CheckBoxes.How will I pass
CheckBoxes parameter in my JSP.
Awaiting ur reply
Biren
On Wed, 7 Jun 2000, Xing Guohong wrote:
> 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);
> }
> file://-->
> </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