Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Problem retrieving value via Request.Form
Hi,

I have the following code in my form:

Response.Write("<form name='Testing'>");
Response.Write("<INPUT type=hidden id='Testing_txtbox'
name='Testing_txtbox' value='a simple test'>");
Response.Write("</form>");

If I type the following in the very next line, I get a value of
"undefined".

Response.Write("value="+Request.Form("Testing_txtbox"));

Can anyone tell me why this won't work.  If it can't can anyone tell
me how I can retrieve values of hidden controls via Server side code?

Thanks


Report this thread to moderator Post Follow-up to this message
Old Post
Chico
06-03-05 08:55 PM


Re: Problem retrieving value via Request.Form
That value won't exist in the Request.Form collection until it is posted by
the client back to the server.  "<input type=hidden..." is merely a string
that is being sent back in the response.  It has no ties to Request.Form.
That comes from when the visitor of your page submits a form.  Then the form
collection will have something called Testing_txtbox.

Ray at work

"Chico" <ckl@ameritech.net> wrote in message
 news:35p0a1hbqa4a3a037tdbl4fc28jok1m8lg@
4ax.com...
> Hi,
>
> I have the following code in my form:
>
> Response.Write("<form name='Testing'>");
> Response.Write("<INPUT type=hidden id='Testing_txtbox'
> name='Testing_txtbox' value='a simple test'>");
> Response.Write("</form>");
>
> If I type the following in the very next line, I get a value of
> "undefined".
>
> Response.Write("value="+Request.Form("Testing_txtbox"));
>
> Can anyone tell me why this won't work.  If it can't can anyone tell
> me how I can retrieve values of hidden controls via Server side code?
>
> Thanks
>



Report this thread to moderator Post Follow-up to this message
Old Post
Ray Costanzo [MVP]
06-03-05 08:55 PM


Re: Problem retrieving value via Request.Form
Add method="post" to your form tag. By default it uses the GET method (ie
uses the querystring) and the form collection is empty...

(you'll likely have also to change the logic as this value is available only
once the user entered something and submitted the form, not during the
initial display).

Patrice

--

"Chico" <ckl@ameritech.net> a écrit dans le message de
 news:35p0a1hbqa4a3a037tdbl4fc28jok1m8lg@
4ax.com...
> Hi,
>
> I have the following code in my form:
>
> Response.Write("<form name='Testing'>");
> Response.Write("<INPUT type=hidden id='Testing_txtbox'
> name='Testing_txtbox' value='a simple test'>");
> Response.Write("</form>");
>
> If I type the following in the very next line, I get a value of
> "undefined".
>
> Response.Write("value="+Request.Form("Testing_txtbox"));
>
> Can anyone tell me why this won't work.  If it can't can anyone tell
> me how I can retrieve values of hidden controls via Server side code?
>
> Thanks
>



Report this thread to moderator Post Follow-up to this message
Old Post
Patrice
06-03-05 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:47 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.