Hazzardusa
Aug 16th 2005, 9:55 pm
i am trying to make a javascript function that contains some asp code so i
can bring info from a database and then loop through the code and write
out all of the "Column2" variables where the "Column1" Variables match a certain number
function clickcombo(elem1,elem2,SelectedItem){
clearcombo(elem2);
'ignore the elem1, elem2, clearcombo and populatecombo2. the main problem
'i am having is getting SI to equal the javascript variable SelectedItem;
<%
Dim SI
Dim Count
SI = %> SelectedItem; <%
Count = 0
Dim cnCity
Dim rsCity
Set cnCity = Server.CreateObject("ADODB.Connection")
Set rsCity = Server.CreateObject("ADODB.Recordset")
cnCity.Open Application("Data_Server")
rsCity.Open "get_City '" & CSTR(SI) & "'", cnCity, adOpenStatic, adLockReadOnly
do while not rsCity.EOF
if SI = rsCity("SID") then 'decide whether StateID = The Selected StateID from the State Dropdown Box
Count = Count + 1
Response.Write "array1[" & Count & "].Value = " & rsCity("City") & ";" & vbcrlf 'Write new JavaScript Array Value
End If
loop
Count.Close
cnCity.Close
Set cnCity.Nothing
rsCity.Close
Set rsCity.Nothing
%>
populatecombo2(elem2, elem1[elem1.selectedIndex].value, array1);
clear array1 'i also don't know how to clear the array in javascript
return true;
}
any help would be very appreciated
can bring info from a database and then loop through the code and write
out all of the "Column2" variables where the "Column1" Variables match a certain number
function clickcombo(elem1,elem2,SelectedItem){
clearcombo(elem2);
'ignore the elem1, elem2, clearcombo and populatecombo2. the main problem
'i am having is getting SI to equal the javascript variable SelectedItem;
<%
Dim SI
Dim Count
SI = %> SelectedItem; <%
Count = 0
Dim cnCity
Dim rsCity
Set cnCity = Server.CreateObject("ADODB.Connection")
Set rsCity = Server.CreateObject("ADODB.Recordset")
cnCity.Open Application("Data_Server")
rsCity.Open "get_City '" & CSTR(SI) & "'", cnCity, adOpenStatic, adLockReadOnly
do while not rsCity.EOF
if SI = rsCity("SID") then 'decide whether StateID = The Selected StateID from the State Dropdown Box
Count = Count + 1
Response.Write "array1[" & Count & "].Value = " & rsCity("City") & ";" & vbcrlf 'Write new JavaScript Array Value
End If
loop
Count.Close
cnCity.Close
Set cnCity.Nothing
rsCity.Close
Set rsCity.Nothing
%>
populatecombo2(elem2, elem1[elem1.selectedIndex].value, array1);
clear array1 'i also don't know how to clear the array in javascript
return true;
}
any help would be very appreciated