I would like to have a textbox character "count up" that will increase the count as a user types and display a text alert when the user crosses the required character but still allows user to continue typing.
If you want to roll your own
HTML
<div>
Type text here:
<input type="text" id="txt" />
</div>
<div id="warning" style="color: red; display: none">
Sorry, too much text.
</div>
<br>
<input type="text" id="counter" disabled="disabled" value="0"/>
Script
$("#txt").keyup(function () {
var i = $("#txt").val().length;
$("#counter").val(i);
if (i > 10) {
$("#warning").show()
} else {
$("#warning").hide()
}
});
JSFiddle here
You can check this plugins http://plugins.jquery.com/plugin-tags/character-counter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With