-2
Good morning Galera,
All right ?
I need to create a field that counts the amount of special characters and displays in an input.
This is my function created to count characters.
function textCounter(field, countfield, maxlimit) {
    if (field.value.length > maxlimit)
    field.value = field.value.substring(0, maxlimit);
    else 
    countfield.value = maxlimit - field.value.length;
}
However I’m not able to display it in input.
Can someone help me ?
Follows html code.
                            <tr><td colspan="3"><b>Descreva aqui suas atribuições:</b></td></tr>
                            <td colspan="3">
                               <textarea maxlength="5000" style="width:99.3%; ; border:1px solid #CCC; min-height:120px" name=message wrap=physical onKeyDown="textCounter(this.form.message,this.form.remLen,500);autoResize()" onKeyUp="textCounter(this.form.message,this.form.remLen,500);" id="txatividades"><?echo exibirCaracter($descricao);?></textarea>
                            </td>
                            <tr>
                                                    <td align="right">
                                                        <table border="0" cellpadding="0" cellspacing="0" style="font-size:10px">
                                                            <tr>
                                                                <td>
                                                                    <font color="#0066FF" size="1">(Max: 500 caracteres) - </font>
                                                                </td>
                                                                <td> 
                                                                    
                                                                </td>
                                                                <td  align="center">
                                                                    Restam:
                                                                </td>                                                                
                                                                <td>
                                                                     <input readonly type=text name=remLen1 size=3 maxlength=3 value="500" style="border:0px; text-align:center;border-bottom-right-radius:10px; font-size:10px">
                                                                </td>
                                                            </tr>                                
                                                        </table>
                                                    </td>
                                                    
                                                </tr>
I’ve already used required to call the page that loads function. but nothing happens