473,382 Members | 1,710 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,382 software developers and data experts.

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.value;
}
</script>
</head>

<body>

<p>Type a word.<br>
<input type="text" name="txtEnterValue" onkeypress="checkKey()"</
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 1290
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.javascript:
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.netwrote:
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.javascript:
On Sep 17, 4:25 am, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
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
counterintuitive 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
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...
4
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...
7
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...
2
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...
2
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"> ...
0
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...
9
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...
7
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,...
9
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...
4
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.