Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.52 KB | None | 0 0
  1.  
  2. // Function
  3.  
  4. <script type="text/javascript">
  5.     function textCounter(field, countfield, maxlimit) {
  6.     if (field.value.length > maxlimit){
  7.         field.value =field.value.substring(0, maxlimit);
  8.     } else {
  9.         countfield.value = maxlimit - field.value.length;
  10.     }
  11.     }
  12. </script>
  13.  
  14.  
  15.  
  16.  
  17. // Textfield
  18.  
  19. <textarea id="userAbout" onkeyup="textCounter(this.form.userAbout, this.form.remLen, 300)"></textarea>
  20.  
  21. // Characters remaining
  22.  
  23. <input id="remLen" type="text" value="300" size="3" maxlength="3" readonly disabled/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement