Picnic Website Code Tutorials

Maximum Textarea Characters Tutorial

View Demo

Place this script just above the closing body tag.

<script type="text/JavaScript">
function limitText(textArea, length) {
    if (textArea.value.length > length) {
        textArea.value = textArea.value.substr(0,length);

Place onKeyPress="limitText(this,20);" in the textarea tag so it looks like the snippit below. Change the value to suit.

<textarea onKeyPress="limitText(this,20);"></textarea>

Need help adding this or other code to your website? Post it here in the forum! Forum


Top Donators

Friends of Mine