Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Can i pass more then one value in a form like quer
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

psalesses
New Member

50 Posts

Posted - 24 March 2002 :  21:13:40  Show Profile
im trying to pass more then one form value with the same name in a form...

i know you can do it with query strings...

if your query string is ?name=john&name=sarah

this is legal:
<%
for x=1 to request.querystring("name").count
response.write(request.querystring("name")(x))
response.write("<br>")
next
%>

can i do this with a form or will it overwrite?

<%
for x=1 to request.form("name").count
response.write(request.form("name")(x))
response.write("<br>")
next
%>

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 24 March 2002 :  21:19:49  Show Profile
I believe the values are retrieved in a comma-delimited list when you do a request.querystring (or form for that matter). So first, you will want to put them in an array using the Split function. something like:

arMyValue = Split(Request.Querystring("FormElement"), ",")
for i = lbound(arMyValue) to ubound(arMyValue)
' do something
next

Nikkol
Go to Top of Page

psalesses
New Member

50 Posts

Posted - 25 March 2002 :  01:18:25  Show Profile
no this will work...
if your query string is ?name=john&name=sarah
<%
for x=1 to request.querystring("name").count
response.write(request.querystring("name")(x))
response.write("<br>")
next
%>

will output:
john
sarah

i was wondering if
<%
for x=1 to request.form("name").count
response.write(request.form("name")(x))
response.write("<br>")
next
%>

would work the same as querystring


Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 25 March 2002 :  07:54:39  Show Profile
So, try it and see

Nikkol
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07