You will also need to do server side validation if you are attempting to
insert/update into a database (i.e., your users may have javascript
disabled in which case a javascript test alone will not be sufficient).
a

Andy Miller
IS Designer
Butte College
530.895.2946

-----Original Message-----
From: Mukta [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 21, 2006 9:42 PM
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