ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 3rd, 2005, 04:55 PM
ashishpisces ashishpisces is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 6 ashishpisces User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 20 sec
Reputation Power: 0
Unhappy request.form not working

Hi,

I know it will sound stupid but I have got a very simple problem. I am trying to pass a value from a textbox in a form to another asp page and displaying it there. I am using request.form for that and response.write but request.form is not getting any value from the form and the target asp page does not display any error as well.

The codes for the pages are;

contactus.asp
---------------
<html>
<head>
Hello
</head>
<body>
<form method="post" action="contactusaction.asp">
<input type="text" name="fname"/>
<input type="button" value="Submit"/>
</form>
</body>
</html>

contactusaction.asp
--------------------
<%@ page language="vbscript"%>

<html>
<body>
<%

Dim x
x=Request.Form("fname")
Response.Write(x)

%>
</body>
</html>

Here it is not printing the name. I dont now what to do.

I am using Win XP Pro with SP2.

Please help me.
Ashish

Reply With Quote
  #2  
Old February 3rd, 2005, 06:47 PM
Anibal Anibal is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 176 Anibal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 20 m 48 sec
Reputation Power: 10
Hey Ashish...blabla

You have two important mistakes:

1) the second input type should be "submit" not "button". Otherwise, the form is not going anyware
2) get rid of that bloody <%@ page language="vbscript"%>. It's completly unecesary, and crushes the page.

Do that and it should work like a swiss watch!! (the code is really simple!!)

Good luck

Anibal.

Reply With Quote
  #3  
Old February 4th, 2005, 11:42 AM
ashishpisces ashishpisces is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 6 ashishpisces User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 20 sec
Reputation Power: 0
Hi Anibal,

Thanks a lot...i will try that and let u know what happened....i am really stupid......i couldn't see the button type.....

cheers,
ashish
Quote:
Originally Posted by Anibal
Hey Ashish...blabla

You have two important mistakes:

1) the second input type should be "submit" not "button". Otherwise, the form is not going anyware
2) get rid of that bloody <%@ page language="vbscript"%>. It's completly unecesary, and crushes the page.

Do that and it should work like a swiss watch!! (the code is really simple!!)

Good luck

Anibal.

Reply With Quote
  #4  
Old February 7th, 2005, 11:19 AM
ashishpisces ashishpisces is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 6 ashishpisces User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 20 sec
Reputation Power: 0
HI Anibal,

I tried what u suggested....but still its the same.....what to do????...Please help me....i am stuck.....

Reply With Quote
  #5  
Old February 7th, 2005, 03:15 PM
Anibal Anibal is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 176 Anibal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 20 m 48 sec
Reputation Power: 10
Unhappy

Hi..I don't know what to say!. I've tested your code (with the modifications I gave you) and it works perfectly...Try removing the "/" at the end of the input tag (although it shouldn't change a thing). Also, try using request("fname") instead of request.Form and use the GET method instead of POST (so you can see in the address bar wheather the field is being sent or not )

If still nothing.... write down an ASP file with only a response.write "hello world" and run it. If it doesn't work, then your server is not processing the ASP files correctly. If it works....you got me there mate!!

Let's see what happens, make sure to let me know...

Anibal.

Reply With Quote
  #6  
Old February 8th, 2005, 05:09 AM
ashishpisces ashishpisces is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 6 ashishpisces User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 20 sec
Reputation Power: 0
Hi,
I tried response.write and get method...both are working but request.form is still not working.....do we need any settings in the server....

ashish


Quote:
Originally Posted by Anibal
Hi..I don't know what to say!. I've tested your code (with the modifications I gave you) and it works perfectly...Try removing the "/" at the end of the input tag (although it shouldn't change a thing). Also, try using request("fname") instead of request.Form and use the GET method instead of POST (so you can see in the address bar wheather the field is being sent or not )

If still nothing.... write down an ASP file with only a response.write "hello world" and run it. If it doesn't work, then your server is not processing the ASP files correctly. If it works....you got me there mate!!

Let's see what happens, make sure to let me know...

Anibal.

Reply With Quote
  #7  
Old February 8th, 2005, 08:23 AM
Anibal Anibal is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 176 Anibal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 20 m 48 sec
Reputation Power: 10
Hey Ash...I wouldn't know about that. I've never configured the server myself, I just programm it . But, look, if request("blabla") works and without .Form(".."), just use it like that. Use:

Dim x
x = request("fname")
response.write x

and that's it. Don't complicate yourself with request.form or request.queryString.....use the method="POST" and request("...."). If request works and response works too, there shouldn't be any problem!!

Good Luck (keep on trying)

Anibal.

Reply With Quote
  #8  
Old February 9th, 2005, 06:10 AM
ashishpisces ashishpisces is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 6 ashishpisces User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 20 sec
Reputation Power: 0
Hi,

Just request("fname") is not working......i am really cluless what to do.....querystring is working but with that i can not carry large data.....please can u ask someone else who knows more about it.....

cheers,
ashish

Reply With Quote
  #9  
Old February 9th, 2005, 12:56 PM
Anibal Anibal is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 176 Anibal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 20 m 48 sec
Reputation Power: 10
Hey Ashish...

This is imposible!! I've shown the code to my "guru" and he couldn't belive his eyes! He took the code you posted, placed it on the server and it worked perfectly. He even tried all the solutions I gave you and they all worked. Are you sure you wrote what I told you? Do you see the variables on the address bar after the ".asp?" ? If request.queryString is working, and request.form is not...your form is somehow not correctly placed or something. I've allways used request("...") and never had a problem with it.
Check the server with someone who knows about it...I'd love to help you further, but I'm out of resources here

Good Luck

Anibal.

PS: What Server are you using? You SO?, etc.....

Reply With Quote
  #10  
Old February 9th, 2005, 03:40 PM
ashishpisces ashishpisces is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 6 ashishpisces User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 20 sec
Reputation Power: 0
Hi Anibal,

Trust me....i have tried whatever you have suggested......i think there is some problem in the server settings which i am not able to figure out......but asp pages are working then could there be any problem in server setting.......I am using IIS5.1....I have also installed .NET Framework......could that be a problem.....

cheers,
ashish

Reply With Quote
  #11  
Old February 9th, 2005, 04:34 PM
Anibal Anibal is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 176 Anibal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 20 m 48 sec
Reputation Power: 10
Hey ashish...

Wow..That's even more weird!! You basicaly have the same configuration I use!...unfortunatly, I don;t know a bit about it. I'm really sorry mate, I don't know what else to tell you, neither does my guru. If you ever find the problem, just let me know!

Anibal.

Reply With Quote
  #12  
Old February 17th, 2005, 04:08 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
Try this script on the page that you are posting to. It'll print out a list of received form items, and their associated values.
Code:
 for each f in request.form()
 	response.write("<p>" & f & " = " & request.form(f) &"</p>")
 next
 

Reply With Quote
  #13  
Old March 18th, 2005, 04:03 AM
Paarma Paarma is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 Paarma User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 26 sec
Reputation Power: 0
I don't believe this!!!

Unbeliavable!
I had the same problem. Tried to debug it for a full day, but nothing helped. Until I came to this forum, and read the comment
"use Request("..") and not Request.Form("..")"

My ASP book uses Request.Form("..") and I haven't had any problems with it before, but now removing the .Field solved the problem.

The funny thing is, that I use the exact same code in another ASP page and it works there just fine with .Field included. (in the same server)

Thank YOU.. You saved my day

Reply With Quote
  #14  
Old July 8th, 2005, 03:03 PM
papagorgio papagorgio is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 1 papagorgio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 12 sec
Reputation Power: 0
Hi, this is my first post to this forum and the reason I am posting is because I had a similar probleam and got frustrated because I could not find any answers online.

Eventually I solved the problem by trying things I never thought would affect it..

My problem was I had a form that POSTs info to the
next form...easy enough...then request the info on the next
page.. done it a million times and never have problems with
it.

For some reason it would not work for me today!

Eventually I tried removing the enctype="multipart/form data" from my form tag and it worked! Don't know why this is or
why I ever declared an enctype.

According to the code below this is not your problem but I wanted to post this info in case someone is looking for the same problem...

hope this helps.



Quote:
Originally Posted by ashishpisces
Hi,

I know it will sound stupid but I have got a very simple problem. I am trying to pass a value from a textbox in a form to another asp page and displaying it there. I am using request.form for that and response.write but request.form is not getting any value from the form and the target asp page does not display any error as well.

The codes for the pages are;

contactus.asp
---------------
<html>
<head>
Hello
</head>
<body>
<form method="post" action="contactusaction.asp">
<input type="text" name="fname"/>
<input type="button" value="Submit"/>
</form>
</body>
</html>

contactusaction.asp
--------------------
<%@ page language="vbscript"%>

<html>
<body>
<%

Dim x
x=Request.Form("fname")
Response.Write(x)

%>
</body>
</html>

Here it is not printing the name. I dont now what to do.

I am using Win XP Pro with SP2.

Please help me.
Ashish

Reply With Quote
  #15  
Old April 28th, 2006, 07:47 PM
pallavy pallavy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Posts: 2 pallavy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 1 m 42 sec
Reputation Power: 0
I have exactly the same problem as ashish. Please help.

Reply With Quote
  #16  
Old March 5th, 2008, 05:17 AM
Dandan2907 Dandan2907 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 1 Dandan2907 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 59 sec
Reputation Power: 0
Eurica

Hi All
Had a very frustrating day but in the end I added the lines:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


before the <html> tag and

<meta http-equiv="content-type" content="text/html; charset=windows-1255">
in the <head> section


(You should change the charset to what your site works with)
And
TADA!!!!!!!

Reply With Quote
  #17  
Old July 18th, 2008, 10:06 AM
Iron420 Iron420 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 1 Iron420 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 43 sec
Reputation Power: 0
Fixed it!

Hey guys,

I had the same problem, but my fix was very simple. I was using id="inputname" instead of name="inputname", I added name in addition to id on all inputs and now it works for me. Hopefully this helps someone.

Reply With Quote
  #18  
Old March 31st, 2010, 04:22 PM
xeilok xeilok is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2010
Posts: 1 xeilok User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 53 sec
Reputation Power: 0
nn

i know this is really old but i just had the same issue and found out it could be related to a known microsoft issue. this is only an issue when using Internet Explorer and using anonymous access.


when posting from a form page what has anonymous access the request.form() does not work in IE, but seems to be fine in Firefox.

In case anyone else was interested...

xD

Reply With Quote
  #19  
Old April 7th, 2010, 02:53 PM
ngaudreau ngaudreau is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2010
Posts: 1 ngaudreau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 59 sec
Reputation Power: 0
I am having the exact same issue, and it seems to have started just today.

I've tried all the solutions posted above and none seem to work. It doesn't work in either IE or FF.

What's strange is that it doesn't seem to be an issue of whether you use Request or Request.Form, because that isn't what is throwing the error. It is the fact that the form method is POST rather than GET.

For example, if my form method is GET, and I use Request("FormField"), it works no problem.
If my form method is POST, and I use the exact same Request("FormField), it does not work anymore.

Another strange thing is that on the exact same server, we have the same code in another site under the same IIS, and it works there!! Driving me crazy. It must be some setting within that site in IIS, but I just can't figure out what it is.


Some more information I found in the logs:
When I use method GET, the log entries in IIS look normal. When I use method POST, I see something like this:

POST /login/logintest.asp |11|80004005|

80004005 must be an error code, because I found this page:
classicasp.aspfaq.com/general/why-do-i-get-non-database-related-80004005-errors.html

I'm sifting through it right now, but haven't found anything that's helped me so far.


EDIT: It is now working!
Ok, so admittedly I'm not exactly sure what got it to work, but I'll tell you the steps I was doing when it suddenly started working again.
1. Restarted IIS - still didn't seem to work
2. In IE, I right-clicked on the page with my form, then selected Encoding > Unicode (UTF-8). The encoding had been pre-selected to be Western European (Windows).
3. After I did that, the form started working for me, in both IE and FF. I was able to submit and see the result of my Request.Forms.
4. I tried switching the Encoding back to Western European (Windows) and it continued to work. Also worked with Western European (ISO) and Unicode still.
5. I told a colleague of mine to just go to the form and submit to see the error, but suddenly she wasn't seeing the error anymore. I asked her to check her encoding, which she hadn't changed, and it was Western European (Windows).
6. So suddenly it is working for all other users too. I have no idea how that could be, but it is working. Didn't have to have them change their Encodings or anything else. So strange!

Reply With Quote
  #20  
Old November 25th, 2012, 12:31 AM
shadow_vatsa shadow_vatsa is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 2 shadow_vatsa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 10 sec
Reputation Power: 0
had response to the following code as <% Dim x x=Request.Form("fname") Response.Write(x) %>

<html>
<head>
Hello
</head>
<body>
<form method="POST" action="saha2.asp">
<input type="text" name="fname"/>
<input type="submit" value="Submit"/>
</form>
</body>
</html>

sah2
____________
<html>
<body>
<%

Dim x
x=Request.Form("fname")
Response.Write(x)

%>
</body>
</html>

PLEASE HELP

Reply With Quote
  #21  
Old November 27th, 2012, 09:02 PM
shadow_vatsa shadow_vatsa is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 2 shadow_vatsa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 10 sec
Reputation Power: 0
Thumbs up maybe

got the anser wasnt using localhost to view the asp file from browser

Reply With Quote
  #22  
Old November 29th, 2012, 07:09 PM
Chris2tina Chris2tina is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 6 Chris2tina User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m
Reputation Power: 0
I am trying to pass a value from a textbox in a form to another asp page and displaying it there.


Reply With Quote
  #23  
Old July 25th, 2014, 09:21 PM
Iiuqws7vf Iiuqws7vf is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2014
Posts: 1 Iiuqws7vf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 11 sec
Reputation Power: 0
another asp page and displaying it there.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > request.form not working


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap