Solved

LIMIT TEXTAREA LENGHT

Posted on 2004-05-01
2
614 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
ID: 10969667
how about
if( this.value.length > 1000) this.value=this.value.substr(0,1000);

_Blue
0
 

Author Comment

by:Evolutionmarketplace
ID: 10969678
PERFECT!!!!!.... THANK YOU VERY, VERY, VERY MUCH!!!!.... POINTS ARE YOURS :D

Pablo
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

839 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