chaoswar4u Posted January 29, 2008 Posted January 29, 2008 I currently have a mailbo chars limit to stop the abusers out there. Is there a way to make the chars cout down when typing so people are aware when there getting to the limit. Many thx in advance for any help. Quote
hamster01 Posted January 29, 2008 Posted January 29, 2008 Re: Mail Box <script language="javascript"> var max = 50; function count(obj) { cur_new = max - document.getElementById(obj).value.length; document.getElementById('counter').innerHTML = cur_new; return true; } </script> Just add the textbox and span/div element. <textarea onkeypress="javascript:count(this.id)" id="co_txt"></textarea> <span id="counter">50</span> http://www.quirksmode.org/dom/maxlength.html Quote
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.