| | |
new and in need
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2004
Posts: 1
Reputation:
Solved Threads: 0
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...
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:
You can then determine the size of the array using:
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:
ASP Syntax (Toggle Plain Text)
dim array array = SPLIT(request.form("list[]"), ",")
You can then determine the size of the array using:
ASP Syntax (Toggle Plain Text)
dim arraySize 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 ::
Lafinboy Productions
:: Website Design :: Website Development ::
![]() |
Other Threads in the ASP Forum
- Previous Thread: simple calculations How? intHrlyRate, etc Help me
- Next Thread: using asp array to store db information
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





