473,406 Members | 2,378 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,406 software developers and data experts.

Updating one textbox based on values in another, and using delete key

Hi All,
I have a page with three textboxes. Call them txt1, txt2, and txt3.
Using javascript I need to populate txt3 with whatever has been typed
into txt1 and txt2 as the information is being entered. No problem
there, but I want to update txt3 whenever the user uses the delete or
backspace key in either txt1 or txt2. I capture the delete or
backspace keystrokes, but when I try to update txt3 it is always a
step behind. That is at the time of the keystrokes the value of txt1
or txt2 has no yet been updated.
Does anyone have any suggestions for how to accomplish this?
TIA,
Sven
Jul 20 '05 #1
2 4553
Thermidor wrote:
Hi All,
I have a page with three textboxes. Call them txt1, txt2, and txt3.
Using javascript I need to populate txt3 with whatever has been typed
into txt1 and txt2 as the information is being entered. No problem
there, but I want to update txt3 whenever the user uses the delete or
backspace key in either txt1 or txt2. I capture the delete or
backspace keystrokes, but when I try to update txt3 it is always a
step behind. That is at the time of the keystrokes the value of txt1
or txt2 has no yet been updated.
Does anyone have any suggestions for how to accomplish this?
TIA,
Sven


Look at http://www.mozilla.org/docs/dom/domr...ef.html#998961

and
http://msdn.microsoft.com/library/de...nce/events.asp

and check the onkeypress event. You can access every keystroke.

Jul 20 '05 #2
@SM


Thermidor a ecrit :

Hi All,
I have a page with three textboxes. Call them txt1, txt2, and txt3.
Using javascript I need to populate txt3 with whatever has been typed
into txt1 and txt2 as the information is being entered. No problem
there, but I want to update txt3 whenever the user uses the delete or
backspace key in either txt1 or txt2. I capture the delete or
backspace keystrokes,


Why to use keys values (that are not same ie on PC & Mac)
when JS has KeyUp & KeyDown ?

<input type=text name=text1
onkeyup="text3.value=this.value+text2.value;">
<input type=text name=text2
onKeyUp="text3.value=text1.value+this.value;">
<input type=text name=text3
onKeyDown="truc=this.value;" onKeyUp="this.value=truc;">
Jul 20 '05 #3

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

Similar topics

1
by: Harry Devine | last post by:
I have a DataGrid that is configured to use the Edit/Update/Cancel concept correctly. My grid shows values from 5 database fields. I only need to update that last 4 fields. The last field is a...
4
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the table needs to be fairly customized (ie, a...
1
by: jason | last post by:
The guts of the below asp.net vb code was pieced together from another thread - all due credit to it's original author. Thank you! I've modified it to maintain a small local Microsoft 2000...
1
by: sekisho | last post by:
I'm dynamically adding a column of labels and a column of text boxes to a panel on a webform, based on data returned from an SQL query, which the user builds by selecting options from a few...
3
by: Trez | last post by:
Hey guys, Am new at using ASP.Net. am having some problems updating my SQL DB. whenever i try i get this Error. Can someone help me? Incorrect syntax near 'nvarchar'. Description: An unhandled...
0
by: TheDebbis | last post by:
I'm making a quick CD catalog to help me learn ASP.NET (using C# primarily.) I have a number of gridview's on my site that are working properly, but for some reason, one is not updating or deleting....
9
by: hrreece | last post by:
I have an Access 2002 database that has a form that can be used to review individual records. At the bottom of the form are buttons that are linked to functions that allow the user to "Find a record...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
0
by: steve | last post by:
I have been fighting with trying to update a GridView for a while. I don't want to use the "built-in" way to do it because I am using business layer methods for updating and deleteing and I don't...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.