Hi all--

I am trying to handle a series of indexed values passed via "post" from
a form on an ASP page. Could someone explain why the following code
separates variables with "<br>" but seems to fail with ", "? When I
change the line indicated by "<===****" I only get the first value.
Interestingly, changing "<br>" to "<, >" gives me "[value]<, >[value]<,
>[value]<, >".

Result (separating with "<br>"):
"Value list: 3
5
7"

Result (separating with ", "):
"Value list: 3"

And how I can construct a variable in the format "[value], [value],
[value], "?

Thanks!
steve

===== code from ASP file ====

<%option explicit%>
<html>
<body>

<%
dim lngTotal, strSelected, i
lngTotal = Request.form("SelCat").Count
strSelected="Value list: "
For i = 1 To lngTotal
strSelected=strSelected & Request.form("SelCat")(i) & "<br>" <===****
Next
Response.Write("<br>")
response.write(strSelected)
%>
</body>
</html>

Re: variable construction from ASP form values by gmail

gmail
Wed May 10 11:13:21 CDT 2006

I found that I could get what I need by returning all values from the
form and running the following:


strTemp=Request.form
strTemp=replace(strTemp,"SelCat=","")
strTemp=replace(strTemp,"%3C%2Ftd&",", ")


Which results in strTemp containing "[value], [value], [value], ".

This seems very awkward. If anyone could explain what I am doing wrong
or misunderstanding I would appreciate it.

Thanks,
steve


gmail wrote:
> Hi all--
>
> I am trying to handle a series of indexed values passed via "post" from
> a form on an ASP page. Could someone explain why the following code
> separates variables with "<br>" but seems to fail with ", "? When I
> change the line indicated by "<===****" I only get the first value.
> Interestingly, changing "<br>" to "<, >" gives me "[value]<, >[value]<,
> >[value]<, >".
>
> Result (separating with "<br>"):
> "Value list: 3
> 5
> 7"
>
> Result (separating with ", "):
> "Value list: 3"
>
> And how I can construct a variable in the format "[value], [value],
> [value], "?
>
> Thanks!
> steve
>
> ===== code from ASP file ====
>
> <%option explicit%>
> <html>
> <body>
>
> <%
> dim lngTotal, strSelected, i
> lngTotal = Request.form("SelCat").Count
> strSelected="Value list: "
> For i = 1 To lngTotal
> strSelected=strSelected & Request.form("SelCat")(i) & "<br>" <===****
> Next
> Response.Write("<br>")
> response.write(strSelected)
> %>
> </body>
> </html>