Validar Formulario
e ai galera blz
o alert do Assunto e Mensagem não funciona os outros o nome Telefone e email funciona normal
o que pode ser
<script>
function valida(form) {
if (form.Nome.value=="") {
alert("Preencha o Nome corretamente.");
form.None.focus();
return false;
}
if (form.Telefone.value=="") {
alert("Preenc
ha o Numero do Telefone corretamente.");
form.Telefone.focus();
return false;
}
if (form.E-mail.value=="") {
alert("Preencha o E-mail corretamente.");
form.E-mail.focus();
return false;
}
if (form.Assunto.value=="") {
alert("Preencha o Assunto corretamente.");
form.Assunto.focus();
return false;
}
if (form.Mensagem.value=="") {
alert("Preencha a Mensagem corretamente.");
form.Mensagem.focus();
return false;
}
}
</script>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="estiloform.css" type="text/css">
</head>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<title>Formulário de Contato</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<p><font face="Arial, Helvetica, sans-serif" size="2"><b><font color="#FF0000" size="4" face="Times New Roman, Times, serif">Formulário de Contato </font></b></font></p>
<font face="Arial, Helvetica, sans-serif" size="2"><b><font color="#FF0000" size="4" face="Times New Roman, Times, serif"> </font></b></font></p>Preencha o formulário Abaixo
<form method="post" enctype="multpart/formdata" name="form1" action="enviar.asp" onsubmit="return valida(this);">
<table width="47%" border="1" cellspacing="2" cellpadding="2">
<tr>
<td width="33%"><font face="Times New Roman, Times, serif" size="3">Nome
: </font></td>
<td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
<input type="text" name="nomerem" size="55">
</font></td>
</tr>
<tr>
<td width="33%"><font face="Times New Roman, Times, serif" size="3">Telefone
: </font></td>
<td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
<input type="text" name="fone" size="55">
</font></td>
</tr>
<tr>
<td width="33%"><font face="Times New Roman, Times, serif" size="3">E-mail
: </font></td>
<td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
<input type="text" name="emailrem" size="55">
</font></td>
</tr>
<tr>
<td width="33%"><font face="Times New Roman, Times, serif" size="3">Assunto: </font></td>
<td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
<input type="text" name="assunto" size="55">
</font></td>
</tr>
<tr>
<td width="33%"><font face="Times New Roman, Times, serif" size="3">Mensagem:</font></td>
<td width="67%">
<textarea name="recado" rows="7" cols="52"></textarea>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Enviar">
<input type="reset" name="reset" value="Limpar">
</div>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>Discussão (2)
Carregando comentários...