Set a character limit on any input/textarea, disabling form submission when exceeded the maximum number.
The HTML:
<textarea data-id="example" data-character-limit="160" class="js-characterlimit"></textarea>
<span class="character-count" data-limit-status="example">160</span>
<button type="submit" data-limit-submit="example">Submit</button>
…and the javascript:
$('.js-characterlimit').characterlimit(/* optional limit */);
- jQuery
- Google Closure (single DOMnode at this point)