473,396 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
6 2033
Type your name:<input name=txt1 type="text">
Jul 19 '05 #2
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
2
by: Kingdom | last post by:
I have a SelectBoxes.asp page that is working with multiple selection dropdown boxes to extract data and total the selection prices. Tom & Bob were kind enough to give me a big help getting this...
4
by: Fred | last post by:
Hi, i know how to pass a value from Javascript to ASP with a hidden field into a form and submitting it, or with cookies, but here i have to pass a lot of data in an array. There is a list of...
0
by: TheCoder | last post by:
I am making a D-base with web conectivity for my class project. I have everything working but the subit button sends the data to the correct fields but afterwards it wants to reproduce new blank...
0
by: hellopraveen30 | last post by:
Here is my form lap and i want to submit data of this form to another form ("http://www.lapkokcasuals.net/jobs/Apply.aspx") without going their how can i do it ihave written these code below data is...
3
by: simora | last post by:
Hi: Need some working sample code to post hidden form data from a php page to a new popup window. 540 x 500 centered. The popup that I'm calling already is formatted and has a TITLE:web-2007.php...
19
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
9
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.