hello my name is Jools... im quite new to asp and have a problem...
sorry if i am not ment to post it here...

Basically I have a page with a form where the user can select details…. This then searches a database for the results and then each result is then written to a page. (so far so good)
Then… next to the results is a check box….

response.write "<td width=""25%""><input type=""checkbox"" name=""list[]"" value="""
response.write rsAddComments.Fields("item")

this is in a loop so their could be any number of them…

if a check box is ticked then the value is saved in the array.

Now for the problem….
On the next asp page where this information is sent I have this…

Dim iArraySize

iArraySize = (UBound(request.form("list[]")) - LBound(request.form("list[]"))) + 1
response.write iarraysize


I also tried this…… just to see if it was because it didn’t like reading it from the form….


dim arrtick
Dim iArraySize

arrtick =request.form("list[]")
iArraySize = (UBound(arrtick) - LBound(arrtick)) + 1
response.write iarraysize

for both it comes up with Type mismatch: 'UBound'

am I just missing some way of telling it that it is an array?

If I response.write request.form("list[]")

It does show the values separated by comers so I know the information is there.
Any ideas?

i will be very gratefull to anyone who has the answer to this...

You have indeed missed creating the array.

You need to convert the comma delimited string returned by the checkbox values into an array. You can achieve this by using the SPLIT function, like:

dim array 
array = SPLIT(request.form("list[]"), ",")

You can then determine the size of the array using:

dim arraySize
arraySize = UBound(array)+1
This article has been dead for over six months. Start a new discussion instead.