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

can i pass data with input text instead of input hidden?

P: n/a
Hi,

The user has to type his name into input a input field (type = text).
This name must be passed to another ASP file.

I did this but nothing happened:
<form id=ins method="post" onsubmit="return doit()">
Type your name:<input id=txt1 type="text">
<INPUT id=smt TYPE="submit">
</form>
....
function doit()
{
document.getElementById("ins").action="file2.asp"
return true;
}
....
When the user types his name and clicks on the submit button, it goes to
file2.asp but the request.form("txt1") is empty.
Do i have to use "hidden" input type instead?

Thanks
Walter
Jul 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Type your name:<input name=txt1 type="text">
Jul 19 '05 #2

P: n/a
You need to give form elements a NAME attribute for the server to be able to
find them.

Ray at work

"Walter" <xx@no.it> wrote in message
news:u%****************@TK2MSFTNGP10.phx.gbl...
Hi,

The user has to type his name into input a input field (type = text).
This name must be passed to another ASP file.

I did this but nothing happened:
<form id=ins method="post" onsubmit="return doit()">
Type your name:<input id=txt1 type="text">
<INPUT id=smt TYPE="submit">
</form>
...
function doit()
{
document.getElementById("ins").action="file2.asp"
return true;
}
...
When the user types his name and clicks on the submit button, it goes to
file2.asp but the request.form("txt1") is empty.
Do i have to use "hidden" input type instead?

Thanks
Walter

Jul 19 '05 #3

P: n/a
Walter wrote on 13 sep 2004 in microsoft.public.inetserver.asp.general:
The user has to type his name into input a input field (type = text).
This name must be passed to another ASP file.

I did this but nothing happened: <input id=txt1 type="text">


<input name="txt1">

In fact not a ASP but a clietside bug, so OT.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 19 '05 #4

P: n/a
Thanks to all
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Walter wrote on 13 sep 2004 in microsoft.public.inetserver.asp.general:
The user has to type his name into input a input field (type = text).
This name must be passed to another ASP file.

I did this but nothing happened:

<input id=txt1 type="text">


<input name="txt1">

In fact not a ASP but a clietside bug, so OT.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 19 '05 #5

P: n/a
Can I just ask why don't you do:
<form id=ins method="post" ACTION="file2.asp">
Is this to force compatibility with a particular browser-only
environment? Does using javascript add some extra flexibility or power?
Or is it just the way some Microsoft tool automatically generates forms?

Just curious.

- Simon

Walter wrote:
Hi,

The user has to type his name into input a input field (type = text).
This name must be passed to another ASP file.

I did this but nothing happened:
<form id=ins method="post" onsubmit="return doit()">
Type your name:<input id=txt1 type="text">
<INPUT id=smt TYPE="submit">
</form>
...
function doit()
{
document.getElementById("ins").action="file2.asp"
return true;
}
...
When the user types his name and clicks on the submit button, it goes to
file2.asp but the request.form("txt1") is empty.
Do i have to use "hidden" input type instead?

Thanks
Walter

Jul 19 '05 #6

P: n/a
He's probably trying to control which page gets submitted to depending on
which button on the form gets pressed.

Bob Barrows
SimonFx wrote:
Can I just ask why don't you do:
<form id=ins method="post" ACTION="file2.asp">
Is this to force compatibility with a particular browser-only
environment? Does using javascript add some extra flexibility or
power? Or is it just the way some Microsoft tool automatically
generates forms?
Just curious.

- Simon

Walter wrote:
Hi,

The user has to type his name into input a input field (type =
text). This name must be passed to another ASP file.

I did this but nothing happened:
<form id=ins method="post" onsubmit="return doit()">
Type your name:<input id=txt1 type="text">
<INPUT id=smt TYPE="submit">
</form>
...
function doit()
{
document.getElementById("ins").action="file2.asp"
return true;
}
...
When the user types his name and clicks on the submit button, it
goes to file2.asp but the request.form("txt1") is empty.
Do i have to use "hidden" input type instead?

Thanks
Walter


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.