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

W

Walter

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
 
R

Ray Costanzo [MVP]

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

Ray at work
 
E

Evertjan.

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.
 
W

Walter

Thanks to all


Evertjan. said:
Walter wrote on 13 sep 2004 in microsoft.public.inetserver.asp.general:



<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)
 
S

SimonFx

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
 
B

Bob Barrows [MVP]

He's probably trying to control which page gets submitted to depending on
which button on the form gets pressed.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top