473,512 Members | 15,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

update textbox with js after onkeydown

I have two textboxes - one editable and visible where the user inputs
data, and one hidden which will be used to warn the user when a
maximum of letters has been entered.

What I need is a js-function which will use two arguments (the name of
the input and output textboxes), and compare the length of the text
with the maxLength. If maxLength is reached it will set the text and/
or visibilty of the other textbox with an appropriate warning.

Is this solvable?
Looking forward to your response.
royend.

Jun 22 '07 #1
1 2886
royend wrote:
I have two textboxes - one editable and visible where the user inputs
data, and one hidden which will be used to warn the user when a
maximum of letters has been entered.

What I need is a js-function which will use two arguments (the name of
the input and output textboxes), and compare the length of the text
with the maxLength. If maxLength is reached it will set the text and/
or visibilty of the other textbox with an appropriate warning.

Is this solvable?
Looking forward to your response.
royend.
Yes:
<script>maxLength=50</script>
<form>
<input type="text"
onkeyup="this.form.message.style.display=this.valu e.length>maxLength?'':'none'">
<input name="message" style="display:none" value="your message">
</form>
Mick
Mick
Jun 22 '07 #2

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

Similar topics

2
10194
by: DDK | last post by:
Question (using C# and ASP.NET), I have a textbox and a buttonClick on my asp.net page. I would like be able to hit the Enter button on the keyboard and have it do the same thing as the...
2
14603
by: George Durzi | last post by:
I have a text box and a button, and I want the enter key to run the click event of the button. The textbox and button are inside a user control. I tried all sorts of stuff with the __EVENTTARGET...
6
1525
by: André Almeida Maldonado | last post by:
Hey guys... In my aspx page I have a textbox that when the user press Return I need to click a button. How can I do it??? OR All the pages that contains buttons have a default button, but I...
11
7712
by: Joe | last post by:
Hello All, I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton (SearchButton) server controls. The user can type search text in SearchTextBox and click SearchButton and...
7
8666
by: DazedAndConfused | last post by:
Curently I manualy code keypress edits. i.e. allow only 3 digits before decimal and two digits after decimal in .NET. Is there an easy solution to mask text boxes? The MSMASK32.OCX from vb6...
2
2468
by: rockdale | last post by:
Hi, All I have a textbox for user to input SSN, I havea javascript to format what he input to SSN format, I also have a onChange postback function to retrieve other info based on the SSN. ...
1
6965
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the...
0
2518
KalariaNitya
by: KalariaNitya | last post by:
Hello, could anybody help me? i have gridview, inside gridview i have one Update button & textbox update button update the quantity entered in textbox. i want to update the quantity on textbox on...
0
7252
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
7517
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
5676
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
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
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 ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
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...

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.