By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,133 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,133 IT Pros & Developers. It's quick & easy.

Problems retrieving data from form

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.