Not exactly an answer to the question but this will limit the number / count down the characters in a text area as you type. 
Also removing any unwanted characters.
CSS:
<style>
div.textarea-wrap{
    padding: 8px 0px;
    border-radius: 3px;
    postion:relative;
    margin: 5px 0px 15px 0px;
}
textarea#styled_text_area {
    width: 93.5%;
    height: 120px;
    font-size: 12px;
    border: 1px solid slategrey;
    border-radius: 3px;
    padding: 8px 3%;
    font-family: Tahoma, sans-serif;
    background: #E3E9ED;
}
.remaining {
    margin: 3px 0px;
    line-height: 10px;
}
div.remaining p{
    color: lightslategrey;
    float: right;
    margin: 4px 3% 0px 0px;
    float:right;
}
.remaining input{
    width:27px;
    border: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    color: lightslategrey;
    float:right;
    margin: 0;
}
</style>
Javascript:
<script> 
function clean(el){
    var textfield = document.getElementById(el);
    var regex = /[^a-z 0-9?!.,]/gi;
    if(textfield.value.search(regex) > -1) {
        textfield.value = textfield.value.replace(regex, "");
        }
}
// Text counter 
var maxAmount = <?php echo($message_input_size);?>;
function textCounter(textField, showCountField) {
    if (textField.value.length > maxAmount) {
        textField.value = textField.value.substring(0, maxAmount);
    } else { 
        showCountField.value = maxAmount - textField.value.length;
    }
}   
</script>
HTML:
<div class="textarea-wrap">
    <textarea name="ta" id="styled_text_area" rows="6" placeholder="Type here..." onKeyDown="textCounter(this.form.ta,this.form.countDisplay), clean('styled_text_area');" onKeyUp="textCounter(this.form.ta,this.form.countDisplay), clean('styled_text_area');"></textarea>   
    <div class="remaining">
    <p>Characters Remaining</p>
    <input readonly type="text" name="countDisplay" size="3" maxlength="3" value="500"><br><br> 
    </div>
</div>