Assuming you want to know if the length of the value of the input element matches the maximum length of this element, you can do something like this (using jQuery).
var $el = $("#myInputElement") var l = $el.val().length; var ms = $el.attr("maxlength"); var m = parseInt(ms, 10);
This, however, is not the same as the truncated value, it may just be the exact length.
If you want to know if the user continues to record after reaching the maximum length, you can use the keyup event viewer and regardless of whether the input is focused. However, you may need Flash to compare the clipboard with your input.
In short, there is no good solution.
source share