473,795 Members | 2,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with textboxes

I am trying to write some javascript code in which you enter some text
in one text box and the text will also appear in the second text box.
For example, if I write the word "Test" both text boxes should have
the same word in them. I need to be able to see the work actually
being typed out in both text boxes as well. If I trye the letter T
then both text boxes should have the same result all the type. If I
delete the letter T then both boxes should delete the letter T and so
forth. If anyone can help with this problem I woule really appreciate
it. Here is a code sample I am using below!

<html>
<head>
<script type="text/javascript">
function checkKey()
{
txtOutput.value = txtEnterValue.v alue;
}
</script>
</head>

<body>

<p>Type a word.<br>
<input type="text" name="txtEnterV alue" onkeypress="che ckKey()"</
p>
<p>The result should appear in this box as you type.<br>
<input type="text" name="txtOutput "</p>

</body>
</html>

Sep 16 '07 #1
9 1312
Daz
EDIT:
You can also call on a form by it's position in the FORMS array:
My examples are FAR from perfect.
Sorry about the typos.

Sep 16 '07 #2
Lee
Kodiak said:
>
I am trying to write some javascript code in which you enter some text
in one text box and the text will also appear in the second text box.
For example, if I write the word "Test" both text boxes should have
the same word in them. I need to be able to see the work actually
being typed out in both text boxes as well.
That's a pretty silly requirement. Is this for a class?
--

Sep 16 '07 #3
Daz
On Sep 16, 4:45 pm, Lee <REM0VElbspamt. ..@cox.netwrote :
That's a pretty silly requirement. Is this for a class?

--
Sorry Lee, but that's a pretty arrogant statement...

The fact that the OP is having trouble obtaining references to form
elements, strongly suggests that he's just starting out with
JavaScript. That doesn't mean he has to write something useful to
start with. I am sure his only goal is to create something simple, and
understand how it works, even if it serves no real purpose.

While criticism is usually welcome, it's usually only welcome when
it's helpful, and reasons as to why a particular method of doing
something may not be the best. You're comment offers absolutely no
help, and gives the impression that anything posted will put under
scrutiny, which is not what we are here to do.

Sep 16 '07 #4
Daz wrote on 16 sep 2007 in comp.lang.javas cript:
On Sep 16, 4:45 pm, Lee <REM0VElbspamt. ..@cox.netwrote :
>That's a pretty silly requirement. Is this for a class?

--
[please do not quote even part of a signature on usenet]
>
Sorry Lee, but that's a pretty arrogant statement...

The fact that the OP is having trouble obtaining references to form
elements, strongly suggests that he's just starting out with
JavaScript. That doesn't mean he has to write something useful to
start with. I am sure his only goal is to create something simple, and
understand how it works, even if it serves no real purpose.

While criticism is usually welcome, it's usually only welcome when
it's helpful, and reasons as to why a particular method of doing
something may not be the best. You're comment offers absolutely no
help, and gives the impression that anything posted will put under
scrutiny, which is not what we are here to do.
So there exists a "what we are here to do"?

That certainly must be your personal conception of usenet,
that it is one gigantic helpdesk.

Iteration:
>That's a pretty silly requirement. Is this for a class?
... a pretty arrogant statement
I certainly don't think it is arrogant,
and I would not use those words easily if I where you,
but I deduct I am not.

Reiteration:
>Is this for a class?
I too would like an answer to that from the OP.

While the requirement is rather silly,
it is a good subject for a home experiment in a teaching assignment.

If so, we should, I think not spoil the learning effect by doing such
experiment for him or her.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 16 '07 #5
Lee
Daz said:
>
On Sep 16, 4:45 pm, Lee <REM0VElbspamt. ..@cox.netwrote :
>That's a pretty silly requirement. Is this for a class?

--

Sorry Lee, but that's a pretty arrogant statement...
Pot. Kettle.
>The fact that the OP is having trouble obtaining references to form
elements, strongly suggests that he's just starting out with
JavaScript. That doesn't mean he has to write something useful to
start with. I am sure his only goal is to create something simple, and
understand how it works, even if it serves no real purpose.

While criticism is usually welcome, it's usually only welcome when
it's helpful, and reasons as to why a particular method of doing
something may not be the best. You're comment offers absolutely no
help, and gives the impression that anything posted will put under
scrutiny, which is not what we are here to do.
Certainly it is part of "what we are here to do". If you blindly
give every poster exactly what they ask for, without considering
why they're asking for it, and what misconceptions or ulterior
motives may lie beneath the request, you're being irresponsible.

Years of experience in this newsgroup suggests that when a poster
asks for something that's trivial and pointless, there's a very
good chance that it's a homework assignment. We shouldn't be
doing homework assignments for students. Do you disagree?

You'll notice that I didn't refuse help. They had already
received help. I simply pointed out why I suspected that it
may be a homework assignment and asked if it, in fact, is.

It may well not be. It might be an attempt at learning on their
own, in which case, more power to them, or it might be an ill-
conceived required "feature" on a web site. There might even be
a very good reason for it, but the odds seem to be against it.

It certainly seems worth asking.
--

Sep 16 '07 #6
On Sep 17, 4:25 am, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
On Sep 16, 4:45 pm, Lee <REM0VElbspamt. ..@cox.netwrote :
[...]
Is this for a class?

I too would like an answer to that from the OP.

While the requirement is rather silly,
it is a good subject for a home experiment in a teaching assignment.

If so, we should, I think not spoil the learning effect by doing such
experiment for him or her.
That presumes that the "learning effect" of struggling with a problem
is more useful that being taught the answer.

Giving novice students brain teasers and expecting them to work it out
themselves is not always the best way to teach. Recent experiments
show that for new learning, it is much more valuable to present
questions with fully worked examples and solutions. Questions that
require application of knowledge should only be asked once the basic
knowledge has been acquired.

Whether the question originated from a school assignment or someone
trying to learn from some other source doesn't make much difference to
me. Such a basic question infers a very new student, the answer
should be framed within that context.
--
Rob

Sep 17 '07 #7
RobG wrote on 17 sep 2007 in comp.lang.javas cript:
On Sep 17, 4:25 am, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
On Sep 16, 4:45 pm, Lee <REM0VElbspamt. ..@cox.netwrote :
[...]
>Is this for a class?

I too would like an answer to that from the OP.

While the requirement is rather silly,
it is a good subject for a home experiment in a teaching assignment.

If so, we should, I think not spoil the learning effect by doing such
experiment for him or her.

That presumes that the "learning effect" of struggling with a problem
is more useful that being taught the answer.
Indeed it does.
Giving novice students brain teasers and expecting them to work it out
themselves is not always the best way to teach.
I wouldn't think that is a good way to go, not without asking the OP what
it's intentions are, and what work he/dhe has done sofar.
Recent experiments
show that for new learning, it is much more valuable to present
questions with fully worked examples and solutions. Questions that
require application of knowledge should only be asked once the basic
knowledge has been acquired.
I wouln't trust those "recent experiments", since they are
counterintuitiv e and I don't know what controlled environment is
presumed.
Whether the question originated from a school assignment or someone
trying to learn from some other source doesn't make much difference to
me. Such a basic question infers a very new student, the answer
should be framed within that context.
So, as I said, without confirmation of tat context, we should presume the
OP is helped best by not answering his/her school asignment for him/her.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 17 '07 #8
Daz
On Sep 16, 7:27 pm, Lee <REM0VElbspamt. ..@cox.netwrote :
Daz said:
On Sep 16, 4:45 pm, Lee <REM0VElbspamt. ..@cox.netwrote :
That's a pretty silly requirement. Is this for a class?
--
Sorry Lee, but that's a pretty arrogant statement...

Pot. Kettle.
The fact that the OP is having trouble obtaining references to form
elements, strongly suggests that he's just starting out with
JavaScript. That doesn't mean he has to write something useful to
start with. I am sure his only goal is to create something simple, and
understand how it works, even if it serves no real purpose.
While criticism is usually welcome, it's usually only welcome when
it's helpful, and reasons as to why a particular method of doing
something may not be the best. You're comment offers absolutely no
help, and gives the impression that anything posted will put under
scrutiny, which is not what we are here to do.

Certainly it is part of "what we are here to do". If you blindly
give every poster exactly what they ask for, without considering
why they're asking for it, and what misconceptions or ulterior
motives may lie beneath the request, you're being irresponsible.

Years of experience in this newsgroup suggests that when a poster
asks for something that's trivial and pointless, there's a very
good chance that it's a homework assignment. We shouldn't be
doing homework assignments for students. Do you disagree?

You'll notice that I didn't refuse help. They had already
received help. I simply pointed out why I suspected that it
may be a homework assignment and asked if it, in fact, is.

It may well not be. It might be an attempt at learning on their
own, in which case, more power to them, or it might be an ill-
conceived required "feature" on a web site. There might even be
a very good reason for it, but the odds seem to be against it.

It certainly seems worth asking.

--
I apologise, and take back my statement. It seemed to me as though you
were saying that what he was wanting to do was "pretty silly".

When you mentioned a class, I thought you were referring to a
JavaScript class (object), it never occured to me that you meant
educational class. Hopefully you can see where I was coming from,
taking your post in the context that I did. I've seen many posts which
set out (or at least appear to set out), to flame someone, and their
ideas.

My humble apologies again. Now if you'll excuse me, I have a rather
large foot to remove from my mouth.

Sep 17 '07 #9
Lee
Daz said:
>
On Sep 16, 7:27 pm, Lee <REM0VElbspamt. ..@cox.netwrote :
>Daz said:
>On Sep 16, 4:45 pm, Lee <REM0VElbspamt. ..@cox.netwrote :
That's a pretty silly requirement. Is this for a class?
>I apologise, and take back my statement. It seemed to me as though you
were saying that what he was wanting to do was "pretty silly".

When you mentioned a class, I thought you were referring to a
JavaScript class (object), it never occured to me that you meant
educational class. Hopefully you can see where I was coming from,
taking your post in the context that I did.
I'll share the blame and will try to be more careful about using the
word "class" in the future.
--

Sep 18 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3149
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together all the fields from two tables, each with about 20 fields. I then have a statistics form that has the query as its source and the form has 273 textboxes on, each with a calculation based on the underlying query values. The form looks like a...
4
1608
by: Jason M | last post by:
Hi, Im very new to c#, so forgive me if this is a really stupid question. Im trying to create a form for entering purchase requests. For each line item I have a quantity, a description unit cost and total cost.. all textboxes. Next to this I have a button that will add a new set of textboxes so people can have more than one line item. As it is now, when you push the button the textboxes appear, and everything below them is moved down...
7
4052
by: Joel Finkel | last post by:
Folks, I have a form that has several TextBoxes, some of which have the TextMode set to MultiLine. Each is pre-loaded with data from a database. The user is allowed to modify each entry. The problem is that only the modified data from the SingleLine TextBoxes are returned. The original data are returned for the MultiLine TextBoxes. Also, if the page is sent to the server (for validation, for instance), only the modified data for the...
2
1129
by: Andy Sutorius via DotNetMonster.com | last post by:
Hi, I remember in classic ASP when you had a webpage with a large number of textboxes and you needed to perform an update sql statement you could loop through all of the fields and dynamically create a sql statement. I have a webform with over 200 textboxes and I need to perform a sql update. Is there a way to do this in ASP.NET? Thanks,
2
1663
by: tomh | last post by:
I need to have TextBoxes included in the ListItems of a RadioButtonList. So it would look something like this: <asp:RadioButtonList runat="server" id="rblError" CellPadding="3"> <asp:ListItem Value="1">Stuck </asp:ListItem>
0
1602
by: anandv81 | last post by:
Hi, I encountered a strange problem while working on an application, the problem goes like this. I am generating a few textboxes at runtime at the server side and added to a placeholder, a value is set for each of the textboxes. There is a button that causes the page to be posted back and the texboxes are re-rendered. When the textboxes are re-rendered the values are reset and these texboxes are again added to the placeholder. The names
9
4027
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New DataTable("SliceInfo") Dim tblSliceRatings As New DataTable("SliceRatings") '.... All the adding datacolumns, datarows, etc. goes here.. DatasetInit.Tables.Add(tblSliceInfo)
7
1482
by: Will1234321 | last post by:
Hello, I am creating an Inventory database and have the following setup to track sales made. I have 2 tables, tblSales and tblSaleItems. tblSales has the following fields: InvoiceNum, Date, PayMethod, CustomerID, TaxExempt?, SalesNotes & SaleID(primary & autonumber). tblSaleItems has: ItemID, SalePrice, SaleQty, SaleID, SaleItemID(Primary, autonumber). These two tables are joined by the SaleID. I have a form tied to tblSales with places for...
9
1378
by: Peted | last post by:
Hi Looking for advice on best way to implement this idea I have a form with 10 text boxes, and one button. when user clicks button i want to transmit info in text boxes to a device, but i only want to transmit data from textboxes that user has changed data in since last button click How can i check if the text box contents have been changed by user, so
4
1894
by: adam_kroger | last post by:
BRIEF EXPLANATION: I have 6 TextBoxes named LIS1, LIS2, LIS3, ... LIS6. I want to be able to reference them using a For/Next loop and either read ot write to them. In VBA I would use something like this: for i = 1 to 6 me.controls("LIS" & i).Value = "" next i Nedless to say, the Controls("LIS" & i).text doesn't work...
0
9672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10436
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.