|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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:
|
|
#4
|
|||
|
|||
|
HI Anibal,
I tried what u suggested....but still its the same.....what to do????...Please help me....i am stuck..... |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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:
|
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||
|
|||
|
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..... |
|
#10
|
|||
|
|||
|
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 |
|
#11
|
|||
|
|||
|
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. |
|
#12
|
||||
|
||||
|
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
|
|
#13
|
|||
|
|||
|
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 ![]() |
|
#14
|
|||
|
|||
|
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:
|
|
#15
|
|||
|
|||
|
I have exactly the same problem as ashish. Please help.
|
|
#16
|
|||
|
|||
|
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!!!!!!! |
|
#17
|
|||
|