Request.Form doesn't work in email

P

Paxton

I created an html email containing a form whose method is POST. The
form is posted to an asp page for processing, but no values are
retrieved. So I response.write all the Request.Form fields, and nothing
appears. I change the form's method to GET, then response.write the
Request.QueryString items (which I can see in the URL) and it works fine.

I need to use POST, as the quantity of data from the form will often
exceed the limits of querystrings. Is there something I'm overlooking?
Why doesn't Request.Form work?

P
 
J

Jeff Dillon

You mean when the user presses SUBMIT, no form values are being passed?

Leave the email part out, and just create the form. Does it still not post?
Also, show your form code, in as few lines as possible to reproduce the
problem

Jeff
 
P

Paxtonend

Jeff Dillon said:
You mean when the user presses SUBMIT, no form values are being passed?

Leave the email part out, and just create the form. Does it still not post?
Also, show your form code, in as few lines as possible to reproduce the
problem

Jeff


Excluding most of the html formatting and questions...
The one that doesn't work:
<FORM action="http://localhost/delegate_survey.asp" method="post">
<INPUT type="hidden" value="90645" name="id">
<input name="Q1" type="checkbox" value="1">Environment for Care<br>
<input name="Q1" type="checkbox" value="2">Design &amp;
Construction<br>
<input name="Q1" type="checkbox" value="3">Facilities Management<br>
<input name="Q1" type="checkbox" value="4">Healthcare Engineering<br>
.... etc
<input type="submit" name="Submit" value="Submit">
</FORM>

and the relevant code in delegate_survey.asp:
<%
If len(Request.Form("id"))>0 then
response.write Request.Form("id")
End If
%>

Nothing is written to the browser when the form is submitted using the
above code. However, if all I do is change the form's method to "get"
and change Request.Form to Request.QueryString in delegate_survey.asp,
I get the value of the id written to the browser.

I View Source of the email in Outlook, and everything is as it should
be in both versions.
 
J

Jeff Cochran

See inline comments:


Excluding most of the html formatting and questions...
The one that doesn't work:
<FORM action="http://localhost/delegate_survey.asp" method="post">
<INPUT type="hidden" value="90645" name="id">
<input name="Q1" type="checkbox" value="1">Environment for Care<br>
<input name="Q1" type="checkbox" value="2">Design &amp;
Construction<br>
<input name="Q1" type="checkbox" value="3">Facilities Management<br>
<input name="Q1" type="checkbox" value="4">Healthcare Engineering<br>
... etc
<input type="submit" name="Submit" value="Submit">
</FORM>

and the relevant code in delegate_survey.asp:
<%
If len(Request.Form("id"))>0 then
response.write Request.Form("id")
End If
%>


How about:

If Request.Form("id") > 0 then

LEN is a string function, you're using numerics for value and may be
running into a type mismatch (though I'd think it would generate an
error).

To test, simply take out your IF/THEN condition and just
Response.Write the information without conditions.

Jeff
 
P

Paxton

Jeff said:
See inline comments:






How about:

If Request.Form("id") > 0 then

LEN is a string function, you're using numerics for value and may be
running into a type mismatch (though I'd think it would generate an
error).

To test, simply take out your IF/THEN condition and just
Response.Write the information without conditions.

Jeff

Tested as you suggested, and no joy. Changed the action to Post, then
response.write Request.Form("id") - nothing appears. Changed it back to
Get, and response.write Request.QueryString("id") - and the id number
appears on the page, laughing at me.
 
P

Paxton

Jeff said:
See inline comments:






How about:

If Request.Form("id") > 0 then

LEN is a string function, you're using numerics for value and may be
running into a type mismatch (though I'd think it would generate an
error).

To test, simply take out your IF/THEN condition and just
Response.Write the information without conditions.

Jeff

I think I've found the cause of the problem. I had a look at my Outlook
inbox, and found other html emails I've received with forms. Some use
GET, some use POST. I tested them all. GET works every time, and POST
doesn't.

Then I tested an email form from Amazon (method POST), and the resulting
web page informed me I might have a problem with my browser!?! I am
(was) using Mozilla Firefox 1.0 as my default. Changed my default
browser back to IE, and it all works fine now. So Firefox must have
been doing something odd. I don't understand how, because Outlook was
effectively the browser at the time the form was submitted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,073
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top