Hello,
I'm trying to loop through a response form, read the value of a given
response....then later write it to a database.
I am having problems with the following code...and am thinking that I have a
problem with the syntax of reading the form response.
Code is as follows.......(Cause a "This page cannot be displayed error")
Each form field is named q1 through q51 etc..
Any Advice?
Mal.
-----------------------------------------------------------------------------------------------
For i = StartNum to EndNum ' Test for numeric (radio Group) or text
answer given and assign query params
QName = "q" & i
Response.Write "QName: " & QName
Response.Write(Request.Form(QName)) &" --FormData-- <br>"
Response.Write "NUMERIC?: " & isnumeric(request.form(QName) &"<br>"
if IsNumeric(Request.(QName) then
Form_NumAnswer = request.form(QName)
Form_TxtAnswer = ""
else
Form_TxtAnswer = request.form(QName)
Form_NumAnswer = null
end if
response.Write i & " - TXT: " & Form_TxtAnswer & "<br>"
response.Write i & " - NUM: " & NZ(Form_NumAnswer,"") & "<br>"
next
Bob Barrows [MVP] - 19 Aug 2006 15:12 GMT
> Hello,
>
[quoted text clipped - 9 lines]
>
> Any Advice?
Show us the real error:
http://www.aspfaq.com/show.asp?id=2109
> -----------------------------------------------------------------------------------------------
> For i = StartNum to EndNum ' Test for numeric (radio Group) or
[quoted text clipped - 4 lines]
> Response.Write(Request.Form(QName)) &" --FormData-- <br>"
> Response.Write "NUMERIC?: " & isnumeric(request.form(QName) &"<br>"
Why are you testing whether the value is numeric before testing that you
even HAVE a value?
Dim val
val=Request.Form(QName)
if len(val) > 0 then
....
else
'no value for supplied variable - let's check the form collection:
for each key ion response.form
response.write key & ": " & request.form(key) & "<BR>"
next
end if

Signature
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Mark J. McGinty - 19 Aug 2006 17:43 GMT
> Hello,
>
[quoted text clipped - 17 lines]
> Response.Write(Request.Form(QName)) &" --FormData-- <br>"
> Response.Write "NUMERIC?: " & isnumeric(request.form(QName) &"<br>"
Syntax error in line above, no closing paren for isnumeric.
> if IsNumeric(Request.(QName) then
Same here.
-Mark
> Form_NumAnswer = request.form(QName)
> Form_TxtAnswer = ""
[quoted text clipped - 7 lines]
>
> next