Javascript - How to get number of characters in textbox and use substring to delete
<p>I want to get the number of characters in a textbox and use substring to remove characters if the number of characters is >= 255</p>

<p>I have the following javascript:</p>

<pre><code>&lt;script language="javascript" type="text/javascript"&gt;
    function CheckMaxLength(Object, MaxLen) 
    {
        if (Object.value.length &gt;= MaxLen) { //find textbox and use substring } 

        return (Object.value.length &lt;= MaxLen);
    }
&lt;/script&gt;
</code></pre>

<p>What javascript should I use?</p>
