/[drupal]/contributions/modules/maxlength/maxlength.js
ViewVC logotype

Contents of /contributions/modules/maxlength/maxlength.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Sun Sep 28 13:07:38 2008 UTC (13 months, 4 weeks ago) by acm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +6 -5 lines
File MIME type: text/javascript
reverting to pre 2.0 code, undoing the mistake of committing to HEAD instead of 5--2
1 /* $Id: maxlength.js,v 1.1 2007/04/21 20:24:56 mariuss Exp $ */
2
3 function maxlength_limit(textarea, limit) {
4 var remainingTag = document.getElementById('maxlength-counter-remaining');
5 var remainingCnt = limit - textarea.value.length;
6
7 if (remainingCnt < 0) {
8 textarea.value = textarea.value.substr(0, limit);
9
10 remainingCnt = 0;
11 }
12
13 remainingTag.innerHTML = remainingCnt;
14 }

  ViewVC Help
Powered by ViewVC 1.1.2