By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,538 Members | 869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,538 IT Pros & Developers. It's quick & easy.

Request.Form doesn't work in email

P: n/a
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
Jul 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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
"Paxton" <paxtonend@[nospamthanyouverymuch]hotmail.com> wrote in message
news:b2******************@fe1.news.blueyonder.co.u k...
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

Jul 22 '05 #2

P: n/a
"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message news:<#3*************@TK2MSFTNGP14.phx.gbl>...
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
"Paxton" <paxtonend@[nospamthanyouverymuch]hotmail.com> wrote in message
news:b2******************@fe1.news.blueyonder.co.u k...
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

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.
Jul 22 '05 #3

P: n/a
See inline comments:
On 30 Nov 2004 01:46:49 -0800, pa*******@hotmail.com (Paxtonend)
wrote:
"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message news:<#3*************@TK2MSFTNGP14.phx.gbl>...
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
"Paxton" <paxtonend@[nospamthanyouverymuch]hotmail.com> wrote in message
news:b2******************@fe1.news.blueyonder.co.u k...
> 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


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

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.


Jul 22 '05 #4

P: n/a
Jeff Cochran wrote:
See inline comments:
On 30 Nov 2004 01:46:49 -0800, pa*******@hotmail.com (Paxtonend)
wrote:

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message news:<#3*************@TK2MSFTNGP14.phx.gbl>...
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
"Paxton" <paxtonend@[nospamthanyouverymuch]hotmail.com> wrote in message
news:b2******************@fe1.news.blueyonder.c o.uk...

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

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


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.
Jul 22 '05 #5

P: n/a
Jeff Cochran wrote:
See inline comments:
On 30 Nov 2004 01:46:49 -0800, pa*******@hotmail.com (Paxtonend)
wrote:

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message news:<#3*************@TK2MSFTNGP14.phx.gbl>...
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
"Paxton" <paxtonend@[nospamthanyouverymuch]hotmail.com> wrote in message
news:b2******************@fe1.news.blueyonder.c o.uk...

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

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


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.

Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.