CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 dependent listboxes problem

Print topic Send  topic

Author Message
suryc_ezra

Posts: 1
Posted: 03/29/2006, 3:08 AM

hi all,

i have 4 dependent listboxes namely:
1. company name
2. project name
3. part no.
4. part name <<<- problem is here!

all 4 listboxes works perfectly when i only have few records in the database. But when i have more than 200-300 records then the problem will come up and "part name" list won't display all the part name from the "part" table. please help im running out of time and the customer is waiting for the system to start running smoothly. it took me days to find the solution but i couldn't one. thanks in advance.


here is the code:

<%
dim rs
dim sql
dim count
dim rs2
dim sql2
dim count2
dim rs3
dim sql3
dim count3
sql = "select distinct project_name,customer_id from project "

openrs rs, sql
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("project_name"))%>","<%= trim(rs("customer_id"))%>","<%= trim(rs("project_name"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
set rs=nothing
%>
onecount=<%=count%>;

function changelocation(customer_id)
{
document.AccountMaint.project_name.length = 0;
document.AccountMaint.part_no.length = 0;
document.AccountMaint.part_name.length = 0;
var customer_id=customer_id;
var i;
document.AccountMaint.project_name.options[0] = new Option('--- Project Name ---','');
document.AccountMaint.part_no.options[0] = new Option('--- Part No. ---','');
document.AccountMaint.part_name.options[0] = new Option('--- Part Name ---','');
for (i=0;i < onecount; i++)
{
if (subcat[1] == customer_id)
{
document.AccountMaint.project_name.options[document.AccountMaint.project_name.length] = new Option(subcat[0], subcat[2]);
}
}

}
</script>

<%sql2 = "select distinct part_no,project_name from part "

openrs rs2,sql2
%>
<script language = "JavaScript">
var onecount2;
onecount2=0;
subcat2 = new Array();
<%
count2 = 0
do while not rs2.eof
%>
subcat2[<%=count2%>] = new Array("<%= trim(rs2("part_no"))%>","<%= trim(rs2("project_name"))%>","<%= trim(rs2("part_no"))%>");
<%
count2 = count2 + 1
rs2.movenext
loop
rs2.close
set rs2=nothing
%>
onecount2=<%=count2%>;

function changelocation2(project_name)
{
document.AccountMaint.part_no.length = 0;
document.AccountMaint.part_name.length = 0;
var project_name=project_name;
var j;
document.AccountMaint.part_no.options[0] = new Option('--- Part No. ---','');
document.AccountMaint.part_name.options[0] = new Option('--- Part Name ---','');
for (j=0;j < onecount2; j++)
{
if (subcat2[j][1] ==project_name)
{
document.AccountMaint.part_no.options[document.AccountMaint.part_no.length] = new Option(subcat2[j][0],subcat2[j][2]);

}
}

}
</script>

<%sql3 = "select * from part order by part_name asc"

openrs rs3,sql3
%>
<script language = "JavaScript">
var onecount3;
onecount3=0;
subcat3 = new Array();
<%
count3 = 0
do while not rs3.eof
%>
subcat3[<%=count3%>] = new Array("<%= trim(rs3("part_name"))%>","<%= trim(rs3("part_no"))%>","<%= trim(rs3("part_name"))%>");
<%
count3 = count3 + 1
rs3.movenext
loop
rs3.close
set rs3=nothing
%>
onecount3=<%=count3%>;

function changelocation3(part_no)
{

document.AccountMaint.part_name.length = 0;

var part_no=part_no;
var k;
document.AccountMaint.part_name.options[0] = new Option('--- Part Name ---','');
for (k=0;k < onecount3; k++)
{
if (subcat3[k][1] ==part_no)
{

document.AccountMaint.part_name.options[document.AccountMaint.part_name.length] = new Option(subcat3[k][0],subcat3[k][2]);

}
}

}
</script>
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.