S
skywalker skywalker
Dear Javascript guru,
I need to create a dynamic javascript array based on the select from
sql data
Firstly, I have 3 tables and its data fields:
tblTable1:
T1-ID, T1-Name
tblTable2:
T2-ID, T2-Name, T1-ID
tblTable3:
T3-ID, T3-Name, T2-ID
Secondly, I have html code with 3 select box:
T1: <SELECT Name="T1" onChange="updateT2()">
<option></option>
here I will have while loop to loop T1 table to load the T1-ID
and T1-Name
<option value="<%=RS("T1-ID")%>"><%=RS("T1-Name")</option>
</SELECT>
T2: <SELECT Name="T2" onChange="updateT3()">
<option></option>
</SELECT>
T3: <SELECT Name="T3">
<option></option>
</SELECT>
T2 and T3 options list will depend on the selection of T1
Once T1 is selected, the T1-ID will checked against T2 table, to
populate T2-ID and T2-Name into T2 Select option list.
Once T2 is selected, the T2-ID will checked against T3 table, to
populate T3-ID and T3-Name into T3 Select option list.
So, I need to do this in javascript updateT2() and updateT3()
function updateT2()
{
var arrT2 = new array();
...
}
function updateT3()
{
var arrT3 - new array();
..
}
Can you advise?
Regards,
Sky
I need to create a dynamic javascript array based on the select from
sql data
Firstly, I have 3 tables and its data fields:
tblTable1:
T1-ID, T1-Name
tblTable2:
T2-ID, T2-Name, T1-ID
tblTable3:
T3-ID, T3-Name, T2-ID
Secondly, I have html code with 3 select box:
T1: <SELECT Name="T1" onChange="updateT2()">
<option></option>
here I will have while loop to loop T1 table to load the T1-ID
and T1-Name
<option value="<%=RS("T1-ID")%>"><%=RS("T1-Name")</option>
</SELECT>
T2: <SELECT Name="T2" onChange="updateT3()">
<option></option>
</SELECT>
T3: <SELECT Name="T3">
<option></option>
</SELECT>
T2 and T3 options list will depend on the selection of T1
Once T1 is selected, the T1-ID will checked against T2 table, to
populate T2-ID and T2-Name into T2 Select option list.
Once T2 is selected, the T2-ID will checked against T3 table, to
populate T3-ID and T3-Name into T3 Select option list.
So, I need to do this in javascript updateT2() and updateT3()
function updateT2()
{
var arrT2 = new array();
...
}
function updateT3()
{
var arrT3 - new array();
..
}
Can you advise?
Regards,
Sky