You can use JSP code to controll first list, then consider to use Java
Script to help with 2nd and 3rd list if you know the value of b1...bn, and
b31...b3n. Like some online site for choose a car trim (Toyota-->Camry-->LE)
some possible code like:
<select name="first" onchange="toSecond();">
//do JSP loop here to populate first
<option value="<%=%>"><%=%>
//end JSP loop
</select>
<select name="second" onchange="toThird();">
</select>
<select name="third">
</select>
function toSecond()
{
var selectedText = document.form[0].first.options[selectedItem].text;
var selectedValue = document.form[0].first.options[selectedItem].value; //
not used here
if (selectedText=="Toyota")
{
//populate second select, the value could be hard code in javascript
// var toyota = {"camry", "corolla", "sienna"};
// or generate by the jsp, if that case do:
// var toyota = <%=(String[])MyBean.getModel("Toyota")%>
for (int i=0; i<toyota.length; i++)
{
document.form[0].second.options[i].value=toyota[i];
document.form[0].second.options[i] = toyota[i];
}
}
else if // do other check
{
}
}
You may need to change somewhere, but this should work.
Dawei
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of S Kumaresan
Sent: Tuesday, February 13, 2001 7:00 AM
To: [EMAIL PROTECTED]
Subject: Dynamic Lists depending on User's selection - urgent
hi gurus,
I am developing a JSP application. In a JSP page, i am having three
selection lists which are dynamic and dependent on one another(populated
from the database). the second and third list values are empty when the page
is loaded. the first list is populated dyn. from the database and depending
on the selected value, the second list should be populated and when the user
selects a value from the second list, the third list should be populated
dyn.
ie
list1-> a, b, c,...n
when the user selects b from list1, then list2 -> b1, b2, b3,...,bn
then when the user selects b3 from list2, values in list3 should be -> b31,
b32,...b3n
I dont know how to solve/work out this...I am stuck in this stage and its
urgent...
Please Help me and any help is appreciated.
Thanks In Advance
yours,
S.Kumaresan
Zensar Technologies Pvt Ltd.,
Pune - INDIA
work id: [EMAIL PROTECTED]
per id: [EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
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".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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