mikelmao Posted January 28, 2009 Share Posted January 28, 2009 How can i get the max amount of chars in a Text Area? Quote Link to comment Share on other sites More sharing options...
mikelmao Posted January 28, 2009 Author Share Posted January 28, 2009 Please? Quote Link to comment Share on other sites More sharing options...
haku Posted January 28, 2009 Share Posted January 28, 2009 I don't know that a textarea HAS a max number of characters. But if you are using GET in your form field, you have a limit if... around 2000 characters I believe, though I don't remember exactly how much. POST will be limited by the settings in your php.ini file, as well as the RAM on the processing computer. So, while the textarea may not have a maximum number of characters (I'm not 100% sure on that), you will have limits to how much data can be transmitted by that textarea. Quote Link to comment Share on other sites More sharing options...
jcombs_31 Posted January 28, 2009 Share Posted January 28, 2009 You'll have to use javascript to limit the characters in a text field. Quote Link to comment Share on other sites More sharing options...
jcombs_31 Posted January 28, 2009 Share Posted January 28, 2009 You'll have to use javascript to limit the characters in a textarea. Quote Link to comment Share on other sites More sharing options...
aznkidzx Posted January 28, 2009 Share Posted January 28, 2009 <!-- Begin function textCounter(field, countfield, maxlimit) { if (field.value.length > maxlimit) // if too long...trim it! field.value = field.value.substring(0, maxlimit); // otherwise, update 'characters left' counter else countfield.value = maxlimit - field.value.length; } // End --> </script> Place in <body> <!-- textCounter() parameters are: text field, the count field, max length --> <form name=myform action="YOUR-SCRIPT.CGI"> <font size="1" face="arial, helvetica, sans-serif"> ( You may enter up to 125 characters. )<br> //change 125 <textarea name=message wrap=physical cols=28 rows=4 onKeyDown="textCounter(this.form.message,this.form.remLen,125);" // change 125 to anything you wish onKeyUp="textCounter(this.form.message,this.form.remLen,125);"></textarea> // change to same as abovce <br> <input readonly type=text name=remLen size=3 maxlength=3 value="125"> characters left</font> // change 125 </form> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.