473,399 Members | 4,177 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,399 software developers and data experts.

help with javascript

i need to use javascript in the following 2 situations but dont know how and
thanks in advance:

1. i have 2 textboxes and they usually contain the same information. when
the user starts entering data in the 1st textbox, the data should also appear
in the 2nd textbox. if needed, the user can modify the data in the 2nd
textbox.

2. i have a textbox and a control beside it. the textbox should have a max.
no. of char. allowed and the control beside it reminds the user how many more
chars. can be entered. as the user enters characters, the control starts
counting down. an example of this is Carfax's textbox for entering the VIN #.
Nov 17 '05 #1
3 1205
Newbie,

I'm a little rusty on my Javascript. =)

For each of these, you will want to attach an event handler for the
textbox so that when it changes, your method is fired (look for an onChange
event). Then, in the event handler, you can modify the contents of the
other textbox, or get the length of the current text and set a label to that
number to show how many characters are typed.

Also, for textboxes, I believe you can set the length attribute in the
input tag to indicate the maximum length of the contents of the textbox.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Newbie" <Ne****@discussions.microsoft.com> wrote in message
news:E0**********************************@microsof t.com...
i need to use javascript in the following 2 situations but dont know how
and
thanks in advance:

1. i have 2 textboxes and they usually contain the same information. when
the user starts entering data in the 1st textbox, the data should also
appear
in the 2nd textbox. if needed, the user can modify the data in the 2nd
textbox.

2. i have a textbox and a control beside it. the textbox should have a
max.
no. of char. allowed and the control beside it reminds the user how many
more
chars. can be entered. as the user enters characters, the control starts
counting down. an example of this is Carfax's textbox for entering the VIN
#.

Nov 17 '05 #2
Hi,

this is a C# NG, you would get a better answer at a javascript NG, take a
look at the onchange event of the input control

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Newbie" <Ne****@discussions.microsoft.com> wrote in message
news:E0**********************************@microsof t.com...
i need to use javascript in the following 2 situations but dont know how
and
thanks in advance:

1. i have 2 textboxes and they usually contain the same information. when
the user starts entering data in the 1st textbox, the data should also
appear
in the 2nd textbox. if needed, the user can modify the data in the 2nd
textbox.

2. i have a textbox and a control beside it. the textbox should have a
max.
no. of char. allowed and the control beside it reminds the user how many
more
chars. can be entered. as the user enters characters, the control starts
counting down. an example of this is Carfax's textbox for entering the VIN
#.

Nov 17 '05 #3
Use the following code,
script:
<SCRIPT language="javascript">
function keyUp()
{
document.all("TextBox4").value = document.all("TextBox2").value;
document.all("TextBox5").value = 100 -
document.all("TextBox2").value.length;
}
</SCRIPT>
design:

<asp:TextBox id="TextBox2" runat="server" onkeyup="keyUp();"></asp:TextBox>
<asp:TextBox id="TextBox4" runat="server"></asp:TextBox>
<asp:TextBox id="TextBox5" runat="server"></asp:TextBox></form>

--
Regards,
Amal [MCP, MCS]
http://geocities.com/techsharing
"Newbie" wrote:
i need to use javascript in the following 2 situations but dont know how and
thanks in advance:

1. i have 2 textboxes and they usually contain the same information. when
the user starts entering data in the 1st textbox, the data should also appear
in the 2nd textbox. if needed, the user can modify the data in the 2nd
textbox.

2. i have a textbox and a control beside it. the textbox should have a max.
no. of char. allowed and the control beside it reminds the user how many more
chars. can be entered. as the user enters characters, the control starts
counting down. an example of this is Carfax's textbox for entering the VIN #.

Nov 17 '05 #4

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

Similar topics

6
by: Edward King | last post by:
Hi! I am trying to achieve the following: I have a number of help pages (in the format help_nn.php where nn=helpid). I want to be able to open a particular help page by calling the function...
5
by: TrvlOrm | last post by:
HI There, I have been struggling with JavaScript code for days now, and this is my last resort! Please help... I am trying to create a JavaScript slide show with links for Next Slide,...
7
by: mike | last post by:
Hello, I am kind of new to this javascript stuff and I am constantly having problems trying to get my webpage validated. I have the following <script>printdate();</script> and when I validate it...
9
by: YZK | last post by:
Hello. I'm not a Web developer, just a user, and I think I may have somehow messed myself up majorly. I'm not quite sure how. Right now, javascript used by websites I go to either does not work at...
5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
0
by: Erland | last post by:
Hello All, I am using AJAX library( AjaxEngine from http://www.mathertel.de/AJAXEngine/) and having problems and hope someone here can help me. I have some piece of javascript code that I...
1
by: JumpingOffPlace | last post by:
Hi, I'm hoping that the wealth of knowledge here can stop me from spinning my wheels on this syntax error for hours. :) Below is the code, and the error I am recieving.... Code: <!DOCTYPE...
36
by: aljamala | last post by:
Hi, I keep getting this warning on a page, but I do not know what the problem is...does anyone have an idea about what could be wrong? line 88 column 7 - Warning: missing </formbefore <td> it...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
7
by: gubbachchi | last post by:
Hi all, In my application I need to display the data fetched from mysql database after the user selects date from javascript calender. I have written the code in which after the user selects the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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?
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
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,...

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.