Solved

LIMIT TEXTAREA LENGHT

Posted on 2004-05-01
2
611 Views
Last Modified: 2012-06-27
Hi Experts!

It is possible to limit the textarea lenght in the same http line in which the textarea is defined (without calling a JS function)?

I am using this:

<textarea name="Customer_Comment" cols="109" rows="15" id="textarea" onkeyup='this.value=this.value.substring(0,1000);'></textarea>

with the event KEYUP, and works fine... but the problem is that is impossible to modify entered text :...(

Thanks in advance,

Pablo.
0
Comment
Question by:Evolutionmarketplace
2 Comments
 
LVL 10

Accepted Solution

by:
eeBlueShadow earned 500 total points
Comment Utility
how about
if( this.value.length > 1000) this.value=this.value.substr(0,1000);

_Blue
0
 

Author Comment

by:Evolutionmarketplace
Comment Utility
PERFECT!!!!!.... THANK YOU VERY, VERY, VERY MUCH!!!!.... POINTS ARE YOURS :D

Pablo
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now