Problem in dropdown with db
<script>
function filldroplist1(){
// this function is used to fill the droplist1 list on load
addOption(document.formname.droplist1,"1","Glazing","");
addOption(document.formname.droplist1,"2","Cladding","");
addOption(document.formname.droplist1,"3","Louver","");
}
function Selectdroplist2(){
// ON selection of droplist1 this function will work
removeAllOptions(document.formname.droplist2);
addOption(document.formname.droplist2,"","droplist2","");
document.formname.action="samepage.jsp?value1="+document.formname.droplist1.value;
document.formname.submit();
document.write(value1)
<%
String prod = (String)request.getParameter("value1") !=null ? (String)request.getParameter("value1") :"none";
out.println("droplist1" +prod);%>
if(document.formname.droplist1.value !='none'){
<%//here getting values from database %>
//adding with drop down here
addOption(document.formname.droplist2,"","<%= product_sub%>");
} %>}}
Here while choosing drop list1 it gets datas from db to drop list2..
My problem is , i can get the values from db but not able to add it to the drop list2?
Could anybody tell me?What is wrong with it?
Suggestions greatly appreciated..
[2259 byte] By [
a1ba] at [2007-11-27 5:06:06]

# 3
function SelectProduct_sub1(){
// ON selection of category this function will work
removeAllOptions(document.drop_list.Product_sub1);
addOption(document.drop_list.Product_sub1, "", "Product_sub1", "");
var value1 = document.getElementById("drop_list").Category.selectedIndex;
document.write(value1)
document.drop_list.submit();
<%
String prod = (String)request.getParameter("value1") != null ? (String)request.getParameter("value1") : "none";
out.println("Category" +prod);%>
Thanks, Without action it simply displays the value(say 1 )..No drop lists.
I checked the syntaxes too..
a1ba at 2007-7-12 10:24:45 >

# 4
Sorry small correction in the above code..
function Selectdroplist2(){
// ON selection of droplist1 this function will work
removeAllOptions(document.formname.droplist2);
addOption(document.formname.droplist2, "", "droplist2", "");
var value1 = document.getElementById("formname").droplist1.selectedIndex;
document.formname.submit();
document.write(value1)
<%
String prod = (String)request.getParameter("value1") != null ? (String)request.getParameter("value1") : "none";
out.println("droplist1" +prod);%>
When i select the first option it simply displays 1..No drop lists .
a1ba at 2007-7-12 10:24:45 >
