Passing an array from ASP to Vbscript

Results 1 to 3 of 3

Thread: Passing an array from ASP to Vbscript

  1. #1
    Join Date
    Dec 1969

    Default Passing an array from ASP to Vbscript

    I have an array which contains the values of a recordset.<BR><BR>I want to pass this array to a function which is called during the Onchange event of a dropdown box. But whenever the array is referenced in a function, it says array is empty.<BR>Is there any way we could pass an array?<BR><BR>------ Rough Code ----------<BR>&#060;SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript&#062;<BR>&#060;!--<BR><BR>Sub FindDates(ByRef arrID)<BR> alert(arrID(0,1))<BR>End Sub<BR>--&#062;<BR>&#060;/SCRIPT&#062;<BR><BR>Some HTML data<BR><BR>&#060;%<BR><BR><BR>Dim arrCourse<BR><BR>&#039;-- Create connection,Cn and recordset, rsCourse --<BR><BR>Redim arrCourse(2,rsCourse.RecordCount-1)<BR><BR>&#039;------ Dropdown box -----------<BR><BR>Response.Write("&#060;SELECT style=&#039;WIDTH: 244px&#039; name=cboFirstCourse Onchange=&#039;FindDates arrCourse&#039;&#062;")<BR><BR>cnt=0<BR>Do while not rsCourse.eof <BR> cnt=rsCourse("CourseID")<BR> Response.write("&#060;OPTION value=" & cnt & "&#062;")<BR> Response.Write(rsCourse("CourseName"))<BR> rsCourse.movenext<BR>Loop <BR>%&#062;<BR><BR>Is it possible to reference the array in a different script of the same page?Any help would be appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing an array from ASP to Vbscript

    Sorry, I&#039;m just a bit confused as to where this array is, and why the &#060;select&#062; is not closed with a &#060;/select&#062; tag, probably is but if you want, send through the complete script to me @ and i&#039;ll take a peek and see if i can help.

  3. #3
    Join Date
    Dec 1969

    Default If you want to use an ASP array...

    on the client side you have to create it on the client side by generating the relevant client side script. Have a look at:<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts