468,145 Members | 1,371 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,145 developers. It's quick & easy.

Problems retrieving data from form

Does anyone see what is wrong with the below code?

File Test1.ASP

<HTML>
<Form action="test2.asp" method="post" ID="frm1">
<input type = "text" ID="txtname">
<Input type="submit" id="submit" value="submit">
</Form>
</HTML>

File Test2.ASP

<HTML>
<%
strname = Request.Form.Item("txtname")
Response.Write (strname)
Response.Write "Hello"
%>
</HTML>

The form submits, however, I only see the "Hello", but do not see the
Response.Write of the "strname" variable. Any ideas?

- doug

Jul 19 '05 #1
2 1719
Try this:

strname = Request.Form("txtname")

Brian

"Doug Partridge" <do***************@nospam.yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Does anyone see what is wrong with the below code?

File Test1.ASP

<HTML>
<Form action="test2.asp" method="post" ID="frm1">
<input type = "text" ID="txtname">
<Input type="submit" id="submit" value="submit">
</Form>
</HTML>

File Test2.ASP

<HTML>
<%
strname = Request.Form.Item("txtname")
Response.Write (strname)
Response.Write "Hello"
%>
</HTML>

The form submits, however, I only see the "Hello", but do not see the
Response.Write of the "strname" variable. Any ideas?

- doug

Jul 19 '05 #2
Figured it out ... the tag from Test1.ASP should be:

<input type = "text" name="txtname">

in order to retrieve the posted value.

- doug
"Doug Partridge" <do***************@nospam.yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Does anyone see what is wrong with the below code?

File Test1.ASP

<HTML>
<Form action="test2.asp" method="post" ID="frm1">
<input type = "text" ID="txtname">
<Input type="submit" id="submit" value="submit">
</Form>
</HTML>

File Test2.ASP

<HTML>
<%
strname = Request.Form.Item("txtname")
Response.Write (strname)
Response.Write "Hello"
%>
</HTML>

The form submits, however, I only see the "Hello", but do not see the
Response.Write of the "strname" variable. Any ideas?

- doug

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jon Dellaria | last post: by
3 posts views Thread by Mark Morton | last post: by
7 posts views Thread by Sirplaya | last post: by
2 posts views Thread by 4Ankit | last post: by
3 posts views Thread by scoots987 | last post: by
3 posts views Thread by Tony K | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.