I am using jQuery.
Objective:
- I am disabling any used input if the max length is reached for a textarea.
- I am handling keyDown event and cancelling it.
Problem:
- The user may want to delete the last word.
Here is a snippet:
editTweet.keydown(function(e) {
// Can i check if the (e) is going to increase the text
var left = Limit - editTweet.val().length;
if (left <= 0) {
return false;
}
spn.text(left);
});