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:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #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: 4
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: 4
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: 4
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: 4
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: 4
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
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
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
 
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

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