new and in need

Reply

Join Date: Oct 2004
Posts: 1
Reputation: Jools is an unknown quantity at this point 
Solved Threads: 0
Jools Jools is offline Offline
Newbie Poster

new and in need

 
0
  #1
Oct 14th, 2004
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...
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Creating an array from a string

 
0
  #2
Oct 15th, 2004
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:

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

You can then determine the size of the array using:
  1. dim arraySize
  2. arraySize = UBound(array)+1
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC