
September 15th, 2004, 08:48 AM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 11
Time spent in forums: 2 h 41 m 27 sec
Reputation Power: 0
|
|
|
ASP inside Javascript
I am using ASP inside my javascript and I am having a little trouble calling the value of a combobox. Here is the code inside my javascript tags:
Code:
<%
Dim i
Dim count
for i = 0 to ubound(ServiceTypes,2) - 1
If ServiceTypes(0,i) = request("TrackNum") Then %>
document.shipInsurance.CarrierCode.options[<%= i %>].value = "<%= ServiceTypes(0,i)%>";
document.shipInsurance.CarrierCode.options[<%= i %>].text = "<%= ServiceTypes(1,i)%>";
<%
End If
count = count + 1
next
%>
ServiceTypes is a multidim array that has the values that I want to dynamically add to a combobox. When the program is loaded 'Carrier' combobox is populated with some values (DHL,UPS, FedEx). The 'CarrierCode' comobox is populated with data associated with what is selected in the 'Carrier' combobox. If the user selects a different 'Carrier' the 'CarrierCode' combobox needs to reflect that change. It seems that everything is working like I want it to if I hardcode
Code:
If ServiceTypes(0,i) = request("TrackNum") Then
with
Code:
If ServiceTypes(0,i) = "DHL" Then
I have tried to use javascript in calling the value but I get an error. How can I do this?
|