Ok here's the problem i'm having. I'm using serverside asp code to generate a javascript object with to properties for
the object which are ID, and Description. Can anyone tell me why cboTeam.value = aryTeam[0].Id is undefined? I would really appreciate someone that knew what they were doing to help me out here. I use the ONLOAD event of the body tag to call trythis javascript function. The javascript array is populating values when i view the source code. Should I be passing in the object to the trythis function or something?
<SCRIPT LANGUAGE='JavaScript'>
<!--HIDE FROM OLDER BROWSERS
var aryTeam = new Array();
<% CALL subCboTeam() %>
function trythis(frmThis)
{
frmThis.cboTeam.options[0] = new Option(""
;
frmThis.cboTeam.options[0].value = aryTeam[0].ID;
frmThis.cboTeam.options[0].text = aryTeam[0].Description;
return;
}
//-->
</SCRIPT>
<%
SUB subCboTeam()
DIM x
strSQL = "SELECT TNCODE, TNDESC FROM TBLTEAMNAMES ORDER BY TNDESC"
SET rsTemp = dbConn.Execute(strSQL)
IF rsTemp.EOF = FALSE THEN
rsTemp.MoveFirst
x = 0
DO WHILE rsTemp.EOF = FALSE
Response.Write "aryTeam[" & x & "] = '" & rsTemp.Fields("TNCODE"
& "';" & vbNewLine
Response.Write "aryTeam[" & x & "].ID = '" & rsTemp.Fields("TNCODE"
& "';" & vbNewLine
Response.Write "aryTeam[" & x & "].Description = '" & rsTemp.Fields("TNDESC"
& "';" & vbNewLine
rsTemp.MoveNext
x = x + 1
LOOP
END IF
END SUB
%> Errol Barratt
856-697-1593
New Jersey
the object which are ID, and Description. Can anyone tell me why cboTeam.value = aryTeam[0].Id is undefined? I would really appreciate someone that knew what they were doing to help me out here. I use the ONLOAD event of the body tag to call trythis javascript function. The javascript array is populating values when i view the source code. Should I be passing in the object to the trythis function or something?
<SCRIPT LANGUAGE='JavaScript'>
<!--HIDE FROM OLDER BROWSERS
var aryTeam = new Array();
<% CALL subCboTeam() %>
function trythis(frmThis)
{
frmThis.cboTeam.options[0] = new Option(""
frmThis.cboTeam.options[0].value = aryTeam[0].ID;
frmThis.cboTeam.options[0].text = aryTeam[0].Description;
return;
}
//-->
</SCRIPT>
<%
SUB subCboTeam()
DIM x
strSQL = "SELECT TNCODE, TNDESC FROM TBLTEAMNAMES ORDER BY TNDESC"
SET rsTemp = dbConn.Execute(strSQL)
IF rsTemp.EOF = FALSE THEN
rsTemp.MoveFirst
x = 0
DO WHILE rsTemp.EOF = FALSE
Response.Write "aryTeam[" & x & "] = '" & rsTemp.Fields("TNCODE"
Response.Write "aryTeam[" & x & "].ID = '" & rsTemp.Fields("TNCODE"
Response.Write "aryTeam[" & x & "].Description = '" & rsTemp.Fields("TNDESC"
rsTemp.MoveNext
x = x + 1
LOOP
END IF
END SUB
%> Errol Barratt
856-697-1593
New Jersey