Posted on 2001-08-27
I am trying to get data out of an array using a client-side subroutine in a ASP page. I have tried to access the content of the array 2 different ways. The first way I defined the array with no dimensions between the script tags, which I thought meant the array was accessable by the entire page. This gives me a subscript out of range error when the subroutine is called from the onclick. I then tried defining the array with dimensions and removing the redim. When I do that I get an "op_array not defined" error when reading the data into the array.
What am I doing wrong?
This is the current code
num = mid(window.event.srcElement.id,4,len
get the # records from the database and set it equal to "count"
select the fields needed for the array into a recordset
loop thru the recordset and insert data into array using counter - i=0
op_array(i,0) = recordset.field
I display data to the screen in a table using the array while looping thru the recordset.
Response.Write "<td><input type=button name=Red" & i & " id=Red" & i & " value=R onclick=set_plus()>"