textarea
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Formulario de Contato</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="form.css" rel="stylesheet" type="text/css">
> <script language="JavaScript">function textCounter(field, countfield, maxlimit) {if (field.value.length > maxlimit) // if too long...trim it!field.value = field.value.substring(0, maxlimit);// otherwise, update 'characters left' counterelse countfield.value = maxlimit - field.value.length;}</script>
</head><body leftmargin="160"><form method="post" action="confirmacao.asp"><table width="435" border="0" cellpadding="0" cellspacing="0" bgcolor="#99FF00"> <!--DWLayoutTable--> <tr> <td height="23" colspan="6" class="titulo"> Contato </td> </tr> <tr> <td height="19" colspan="6"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td width="95" height="18" class="tilulocaixa">Nome:</td> <td colspan="5"><input name="nome" type="text" class="caixa" id="nome"></td> </tr> <tr> <td height="19" colspan="6"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td height="18" class="tilulocaixa">Email:</td> <td colspan="5"><input name="email" type="text" class="caixa" id="email"></td> </tr> <tr> <td height="19" colspan="6"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td height="18" class="tilulocaixa">Assunto:</td> <td colspan="5"><input name="assunto" type="text" class="caixa" id="assunto" maxlength="90"></td> </tr> <tr> <td height="19" colspan="6"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td height="20" class="tilulocaixa">Profissão:</td> <td colspan="5"><select name="profissao" size="1" class="menuopcao" id="profissao"> <option value="estudante">Estudante <option value="programador">Programador <option value="medico">Médico</option> </select></td> </tr> <tr> <td height="9" colspan="6"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td height="19" valign="top" class="tilulocaixa">Sexo:</td> <td colspan="5" valign="top" class="botaoselec">masculino <input name="sexo" type="checkbox" id="sexo" value="masculino"> feminino <input name="sexo" type="checkbox" id="sexo" value="femi </tr>nino"></td> <tr> <td height="19" colspan="6"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td height="80" class="tilulocaixa">Mensagem:</td> <td colspan="5">
> <textarea name="mensagem" cols="28" rows="4" wrap="physical" class="caixamensagem" id="mensagem" onKeyDown="textCounter(this.form.message,this.form.remLen,125);" onKeyUp="textCounter(this.form.message,this.form.remLen,125);"></textarea>
</td> </tr> <tr> <td height="19" colspan="6"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td height="22"> </td> <td width="56"> </td> <td width="50" valign="top"><input name="Submit" type="submit" class="botao" value="Enviar"> </td> <td width="23"> </td> <td width="50" valign="top"><input name="Submit2" type="reset" class="botao" value="Limpar"> </td> <td width="161"> </td> </tr> <tr> <td height="19" colspan="6"><!--DWLayoutEmptyCell--> </td> </tr></table><table width="436" border="0" cellspacing="0" cellpadding="0"> </table></form></body></html>Estou usando esse codigo JavaScript para limitar o textarea.Massssss...Sempre está dando erro nesta linha
> if (field.value.length > maxlimit)
Dá a mensagem value é nulo ou não é um objeto.Uma ajudinha por favor..mandei o codigo inteiro pois quando uso o script em uma pagina simples não acontesse o problema.Discussão (3)
Carregando comentários...