Sorry I mean "textarea". I have mistakenly written "textbox" for "textarea".
Anyways, its just a variable name. Doesn't affect the functionality.


-----Original Message-----
From: Mukta [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 22, 2006 10:12 AM
To: 'Struts Users Mailing List'
Subject: RE: textarea

Use following javascript function to limit the number of characters to 255
in a textbox:

function checkLength(name)
{
        var textBox = document.getElementsByName(name)[0].value;
        if (textBox.length>255)
        {
                document.getElementsByName(name)[0].value =
textBox.substring(0,255);
        }
}

And call this function on 

onkeyup="checkLength('textareaName');"
onmouseout="checkLength('textareaName');"




-----Original Message-----
From: Abhimanyu Koul [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 21, 2006 3:48 PM
To: Struts Mailing list
Subject: textarea

how can i set the maximum number of chars in a textarea. i can only set
columns and rows.

Regards,
Abhimanyu Koul
FinEng Solutions (P)  Ltd.
Mobile : +91 9819510090



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to