olá pessoal do GUJ estou tendo dificuldades para validadar CPF e Data fiz de um jeito e não deu certo
para localizar O CPF e a Data coloquei comentários em Verde
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
function formatar(src, mask)
{
var i = src.value.length;
var saida = mask.substring(0,1);
var texto = mask.substring(i)
if (texto.substring(0,1) != saida)
{
src.value += texto.substring(0,1);
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>MEDTRAB webapp</title>
<style type="text/css">
body,td,th {
font-family: "Comic Sans MS", cursive;
font-size: 16px;
color: #900;
}
body {
background-color: #FF9;
}
a:link {
color: #900;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #900;
}
a:hover {
text-decoration: underline;
color: #900;
}
a:active {
text-decoration: none;
color: #900;
}
</style>
</head>
<body>
<p>Se eu utilizar ç e não for com codificação adequada o que acontecerá?
</p>
<p> </p>
<div align="center">
<table width="85%" border="0">
<tr>
<td background="fundo.jpg" colspan="2" height="100"><div align="center">MEDTRAB Clínica de Medicina do Trabalho </div></td>
</tr>
<tr>
<td bgcolor="#cccccc" width="25%" height="50"><a href="index.html">Home</a></td>
<td width="68%" rowspan="5" bgcolor="#ff9"><p align="center"><strong><font size="+2">Inclusão de Pacientes</font></strong></p>
<form id="form1" name="form1" method="post" action="P_ins_mensagem.html">
<p><font size="+1">Preencha os campos abaixo:</font></p>
<table width="80%" border="0">
<tr>
<td width="30%">Nome</td>
<td width="70%"><label for="nome"></label>
<input name="nome" type="text" id="nome" size="60" maxlength="50" /></td>
</tr>
<tr>
<td>Data de Nascimento</td> //PRIMEIRA SITUAÇÃO
<td><label for="data"></label>
<P><input name="data" id="data" onkeypress="formatar(this, ##/##/####')" value=" " size="20" maxlength="10" maxlengt="8"></P>
</td>
</tr>
<tr>
<td>CPF</td> //SEGUNDA SITUAÇÃO
<td><label for="cpf"></label>
<P><INPUT onkeypress="formatar(this,'000.000.000-00')" id=dta
style="WIDTH: 100px; HEIGHT: 17px" maxLength=14 size=30 name=dta
background-color:#FFFFFF? padding-bottom:1px; padding-top:1px;
padding-right:4px; padding-left:4px; font-weight:700; 8pt; font-size: Verdana;
font-family: border-width:1px; style:dashed;></P>
</td>
</tr>
<tr>
<td>Sexo</td>
<td><input type="radio" name="radio" id="M" value="m" />
<label for="M">Masculino
<input type="radio" name="radio" id="F" value="f" />
Feminino</label></td>
</tr>
<tr>
<td>Endereço</td>
<td><label for="endereco"></label>
<input name="endereco" type="text" id="endereco" size="60" maxlength="55" /></td>
</tr>
<tr>
<td> </td>
<td><input type="reset" name="Limpar campos" id="Limpar campos" value="Limpar Campos" /> <input type="submit" name="Enviar Dados" id="Enviar Dados" value="Enviar Dados" /></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td height="50" bgcolor="#ccff99"><a href="Pacientes.html">Pacientes</a></td>
</tr>
<tr>
<td height="50" bgcolor="#cccccc"><a href="Consultas.html">Consultas</a></td>
</tr>
<tr>
<td height="50" bgcolor="#cccccc"><a href="Funcionarios.html">Funcionários</a></td>
</tr>
<tr>
<td height="50" bgcolor="#cccccc"><a href="Ajuda.html">Ajuda</a></td>
</tr>
<tr>
<td background="fundo.jpg" colspan="2" height="50"><div align="center">Desenvolvido por Robério© Todos os direitos reservados</div></td>
</tr>
</table>
</div>
<p> </p>
</body>
</html>