VALIDARCAMPOS
Pessoal estou usando o que geralmente uso pra Validar Campos. só que por algum motivo ... desconhecido
Quando executo o Submit de Incluir .... inclui sem Validar e dar as Respectivas mensagens
O Validar não está funcionando , mais parece tudo estar certo .... alguem saberia de algo ?
<script language=[Ô]javascript[Ô]>
function validarCampos () {
if (document.frmContatoInc.txtNome.value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Nome![Ô]);
document.frmContatoInc.txtNome.focus();
return false;
}
if (document.frmContatoInc.txtEmail.value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Email![Ô]);
document.frmContatoInc.txtEmail.focus();
return false;
}
if (document.frmContatoInc.txttelefone.value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Telefone![Ô]);
document.frmContatoInc.txttelefone.focus();
return false;
}
if (document.frmContatoInc.txtassunto.value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Assunto![Ô]);
document.frmContatoInc.txtassunto.focus();
return false;
}
if (document.frmContatoInc.txtmensagem.value == [Ô][Ô]) {
alert([Ô]Por favor, informe a Mensagem![Ô]);
document.frmContatoInc.txtmensagem.focus();
return false;
}
}
</script>
FORM
<form action=[Ô]Inserir.asp[Ô] method=[Ô]post[Ô] name=[Ô]frmContatoInc[Ô] id=[Ô]frmContatoInc[Ô] onSubmit=[Ô]return validarCampos();[Ô]>
SUBMIT
<input type=[Ô]submit[Ô] name=[Ô]Submit[Ô] value=[Ô]Incluir[Ô]>
Quando executo o Submit de Incluir .... inclui sem Validar e dar as Respectivas mensagens
O Validar não está funcionando , mais parece tudo estar certo .... alguem saberia de algo ?
<script language=[Ô]javascript[Ô]>
function validarCampos () {
if (document.frmContatoInc.txtNome.value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Nome![Ô]);
document.frmContatoInc.txtNome.focus();
return false;
}
if (document.frmContatoInc.txtEmail.value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Email![Ô]);
document.frmContatoInc.txtEmail.focus();
return false;
}
if (document.frmContatoInc.txttelefone.value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Telefone![Ô]);
document.frmContatoInc.txttelefone.focus();
return false;
}
if (document.frmContatoInc.txtassunto.value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Assunto![Ô]);
document.frmContatoInc.txtassunto.focus();
return false;
}
if (document.frmContatoInc.txtmensagem.value == [Ô][Ô]) {
alert([Ô]Por favor, informe a Mensagem![Ô]);
document.frmContatoInc.txtmensagem.focus();
return false;
}
}
</script>
FORM
<form action=[Ô]Inserir.asp[Ô] method=[Ô]post[Ô] name=[Ô]frmContatoInc[Ô] id=[Ô]frmContatoInc[Ô] onSubmit=[Ô]return validarCampos();[Ô]>
SUBMIT
<input type=[Ô]submit[Ô] name=[Ô]Submit[Ô] value=[Ô]Incluir[Ô]>
Coloque um alert nessa function de validação e veja se está mesmo caindo nela antes de submeter. Apesar de eu sugerir o uso do getElementById:
if (document.getElementById([ô]txtNome[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Nome![Ô]);
document.getElementById([ô]txtNome[ô]).focus();
return false;
}
if (document.getElementById([ô]txtNome[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Nome![Ô]);
document.getElementById([ô]txtNome[ô]).focus();
return false;
}
{
alert([Ô]Passei por Aqui![Ô])
}
Mas não passou ,
alert([Ô]Passei por Aqui![Ô])
}
Mas não passou ,
Experimente colocar a validação no botão de submit...
<input type=[Ô]submit[Ô] name=[Ô]Submit[Ô] value=[Ô]Incluir[Ô] onclick=[Ô]return validarCampos();[Ô]>
<input type=[Ô]submit[Ô] name=[Ô]Submit[Ô] value=[Ô]Incluir[Ô] onclick=[Ô]return validarCampos();[Ô]>
Tambem tentei ..... nem no Click validou ......
engraçado que de 4 entidades ... 2 funcionam ...... e 2 não funcionam
Os forms que tem mais campos .. é os que nao funcionam .... o Script
engraçado que de 4 entidades ... 2 funcionam ...... e 2 não funcionam
Os forms que tem mais campos .. é os que nao funcionam .... o Script
Cara, posta o asp todo ae, pra eu ver...
<%@LANGUAGE=[Ô]VBSCRIPT[Ô] CODEPAGE=[Ô]1252[Ô]%>
<!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>
<title> Inserir Contato</title>
<link rel=[Ô]stylesheet[Ô] href=[Ô]styles.css[Ô] type=[Ô]text/css[Ô] />
<script language=[Ô]javascript[Ô]>
function validarCampos () {
if (document.getElementById([ô]txtNome[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Nome![Ô]);
document.getElementById([ô]txtNome[ô]).focus();
return false;
}
if (document.getElementById([ô]txtEmail[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Email![Ô]);
document.getElementById([ô]txtEmail[ô]).focus();
return false;
}
if (document.getElementById([ô]txttelefone[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Telefone![Ô]);
document.getElementById([ô]txttelefone[ô]).focus();
return false;
}
if (document.getElementById([ô]txtassunto[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Assunto![Ô]);
document.getElementById([ô]txtassunto[ô]).focus();
return false;
}
if (document.getElementById([ô]txtmensagem[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe A Mensagem![Ô]);
document.getElementById([ô]txtmensagem[ô]).focus();
return false;
}
}
</script>
<style>
TD{
font-family:verdana;
font-size:8pt;
}
a{
text-decoration:none;
}
.style1 {color: #000000}
.style2 {font-size: 10pt}
.style3 {font-size: 10; }
.style4 {font-size: 10pt; color: #FFFFFF; }
.style6 {font-size: 10px}
</style>
</head>
<body topmargin=[Ô]0[Ô] rightmargin=[Ô]0[Ô] marginwidth=[Ô]0[Ô] marginheight=[Ô]0[Ô] leftmargin=[Ô]0[Ô] bottommargin=[Ô]0[Ô]>
<table width=[Ô]100%[Ô] cellspacing=[Ô]0[Ô] cellpadding=[Ô]0[Ô] border=[Ô]0[Ô] height=[Ô]100%[Ô]>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô]><table width=[Ô]100%[Ô] cellspacing=[Ô]0[Ô] cellpadding=[Ô]0[Ô] border=[Ô]0[Ô] height=[Ô]100%[Ô]>
<tr>
<td width=[Ô]1[Ô] background=[Ô]images/top_r.jpg[Ô]></td>
</tr>
<tr></tr>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô] background=[Ô]images/line2.jpg[Ô] height=[Ô]2[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/line2.jpg[Ô]></td>
</tr>
<tr>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/last.jpg[Ô] height=[Ô]20[Ô] style=[Ô]color: #652200[Ô] align=[Ô]right[Ô]> </td>
<td width=[Ô]1[Ô] background=[Ô]images/last.jpg[Ô]></td>
</tr>
</table></td>
<td width=[Ô]1[Ô] background=[Ô]images/top_r.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/r_bg.jpg[Ô] height=[Ô]87[Ô] align=[Ô]center[Ô] style=[Ô]font-family: Arial[Ô]><p><img src=[Ô]Topo.jpg[Ô] width=[Ô]970[Ô] height=[Ô]87[Ô]></p> </td>
<td width=[Ô]1[Ô] background=[Ô]images/line1.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô] background=[Ô]images/line2.jpg[Ô] height=[Ô]2[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/line2.jpg[Ô]></td>
</tr>
<tr>
<td background=[Ô]images/bg1.jpg[Ô] width=[Ô]223[Ô] valign=[Ô]top[Ô]><p> </p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</p>
</td>
<td height=[Ô]100%[Ô] valign=[Ô]top[Ô] width=[Ô]565[Ô] style=[Ô]padding-right: 10; padding-left: 10[Ô]>
<BR><p><CENTER><a href=[Ô]../admin.asp[Ô]>MENU</a></CENTER></p><BR>
<form action=[Ô]Inserir.asp[Ô] method=[Ô]post[Ô] name=[Ô]FormInserir[Ô] id=[Ô]FormInserir[Ô] >
<table width=[Ô]528[Ô] border=[Ô]0[Ô]>
<tr>
<td width=[Ô]114[Ô] bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]><p>Nome:</p></td>
<td width=[Ô]398[Ô] class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtnome[Ô] id=[Ô]txtnome[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]60[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>E-mail:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtemail[Ô] id=[Ô]txtemail[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]250[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Telefone:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txttelefone[Ô] id=[Ô]txttelefone[Ô] type=[Ô]text[Ô] size=[Ô]15[Ô] maxlength=[Ô]15[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Assunto:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtassunto[Ô] id=[Ô]txtassunto[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]250[Ô]>
</label>
</span></td>
</tr>
<tr>
<td height=[Ô]46[Ô] bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Mensagem:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<textarea name=[Ô]txtmensagem[Ô] id=[Ô]txtmensagem[Ô] cols=[Ô]55[Ô] rows=[Ô]15[Ô]></textarea>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#FFFFFF[Ô]> </td>
<td><span class=[Ô]style6[Ô]>
<label>
<input type=[Ô]submit[Ô] name=[Ô]Submit[Ô] value=[Ô]Incluir[Ô] onclick=[Ô]return validarCampos();[Ô] >
<input type=[Ô]reset[Ô] name=[Ô]Submit2[Ô] value=[Ô]Cancelar[Ô]>
</label>
</span></td>
</tr>
</table>
<br>
</p>
</form></td>
<td valign=[Ô]top[Ô] background=[Ô]images/bg3.jpg[Ô] width=[Ô]194[Ô] style=[Ô]font: 7pt[Ô]><br>
<div style=[Ô]padding-left: 10; padding-right: 10[Ô]></div></td>
<td width=[Ô]1[Ô] background=[Ô]images/r_bg.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/last.jpg[Ô] height=[Ô]20[Ô] style=[Ô]color: #652200[Ô] align=[Ô]right[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/last.jpg[Ô]></td>
</tr>
</table>
</body>
</html>
<!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>
<title> Inserir Contato</title>
<link rel=[Ô]stylesheet[Ô] href=[Ô]styles.css[Ô] type=[Ô]text/css[Ô] />
<script language=[Ô]javascript[Ô]>
function validarCampos () {
if (document.getElementById([ô]txtNome[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Nome![Ô]);
document.getElementById([ô]txtNome[ô]).focus();
return false;
}
if (document.getElementById([ô]txtEmail[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Email![Ô]);
document.getElementById([ô]txtEmail[ô]).focus();
return false;
}
if (document.getElementById([ô]txttelefone[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Telefone![Ô]);
document.getElementById([ô]txttelefone[ô]).focus();
return false;
}
if (document.getElementById([ô]txtassunto[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Assunto![Ô]);
document.getElementById([ô]txtassunto[ô]).focus();
return false;
}
if (document.getElementById([ô]txtmensagem[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe A Mensagem![Ô]);
document.getElementById([ô]txtmensagem[ô]).focus();
return false;
}
}
</script>
<style>
TD{
font-family:verdana;
font-size:8pt;
}
a{
text-decoration:none;
}
.style1 {color: #000000}
.style2 {font-size: 10pt}
.style3 {font-size: 10; }
.style4 {font-size: 10pt; color: #FFFFFF; }
.style6 {font-size: 10px}
</style>
</head>
<body topmargin=[Ô]0[Ô] rightmargin=[Ô]0[Ô] marginwidth=[Ô]0[Ô] marginheight=[Ô]0[Ô] leftmargin=[Ô]0[Ô] bottommargin=[Ô]0[Ô]>
<table width=[Ô]100%[Ô] cellspacing=[Ô]0[Ô] cellpadding=[Ô]0[Ô] border=[Ô]0[Ô] height=[Ô]100%[Ô]>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô]><table width=[Ô]100%[Ô] cellspacing=[Ô]0[Ô] cellpadding=[Ô]0[Ô] border=[Ô]0[Ô] height=[Ô]100%[Ô]>
<tr>
<td width=[Ô]1[Ô] background=[Ô]images/top_r.jpg[Ô]></td>
</tr>
<tr></tr>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô] background=[Ô]images/line2.jpg[Ô] height=[Ô]2[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/line2.jpg[Ô]></td>
</tr>
<tr>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/last.jpg[Ô] height=[Ô]20[Ô] style=[Ô]color: #652200[Ô] align=[Ô]right[Ô]> </td>
<td width=[Ô]1[Ô] background=[Ô]images/last.jpg[Ô]></td>
</tr>
</table></td>
<td width=[Ô]1[Ô] background=[Ô]images/top_r.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/r_bg.jpg[Ô] height=[Ô]87[Ô] align=[Ô]center[Ô] style=[Ô]font-family: Arial[Ô]><p><img src=[Ô]Topo.jpg[Ô] width=[Ô]970[Ô] height=[Ô]87[Ô]></p> </td>
<td width=[Ô]1[Ô] background=[Ô]images/line1.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô] background=[Ô]images/line2.jpg[Ô] height=[Ô]2[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/line2.jpg[Ô]></td>
</tr>
<tr>
<td background=[Ô]images/bg1.jpg[Ô] width=[Ô]223[Ô] valign=[Ô]top[Ô]><p> </p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</p>
</td>
<td height=[Ô]100%[Ô] valign=[Ô]top[Ô] width=[Ô]565[Ô] style=[Ô]padding-right: 10; padding-left: 10[Ô]>
<BR><p><CENTER><a href=[Ô]../admin.asp[Ô]>MENU</a></CENTER></p><BR>
<form action=[Ô]Inserir.asp[Ô] method=[Ô]post[Ô] name=[Ô]FormInserir[Ô] id=[Ô]FormInserir[Ô] >
<table width=[Ô]528[Ô] border=[Ô]0[Ô]>
<tr>
<td width=[Ô]114[Ô] bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]><p>Nome:</p></td>
<td width=[Ô]398[Ô] class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtnome[Ô] id=[Ô]txtnome[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]60[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>E-mail:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtemail[Ô] id=[Ô]txtemail[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]250[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Telefone:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txttelefone[Ô] id=[Ô]txttelefone[Ô] type=[Ô]text[Ô] size=[Ô]15[Ô] maxlength=[Ô]15[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Assunto:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtassunto[Ô] id=[Ô]txtassunto[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]250[Ô]>
</label>
</span></td>
</tr>
<tr>
<td height=[Ô]46[Ô] bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Mensagem:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<textarea name=[Ô]txtmensagem[Ô] id=[Ô]txtmensagem[Ô] cols=[Ô]55[Ô] rows=[Ô]15[Ô]></textarea>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#FFFFFF[Ô]> </td>
<td><span class=[Ô]style6[Ô]>
<label>
<input type=[Ô]submit[Ô] name=[Ô]Submit[Ô] value=[Ô]Incluir[Ô] onclick=[Ô]return validarCampos();[Ô] >
<input type=[Ô]reset[Ô] name=[Ô]Submit2[Ô] value=[Ô]Cancelar[Ô]>
</label>
</span></td>
</tr>
</table>
<br>
</p>
</form></td>
<td valign=[Ô]top[Ô] background=[Ô]images/bg3.jpg[Ô] width=[Ô]194[Ô] style=[Ô]font: 7pt[Ô]><br>
<div style=[Ô]padding-left: 10; padding-right: 10[Ô]></div></td>
<td width=[Ô]1[Ô] background=[Ô]images/r_bg.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/last.jpg[Ô] height=[Ô]20[Ô] style=[Ô]color: #652200[Ô] align=[Ô]right[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/last.jpg[Ô]></td>
</tr>
</table>
</body>
</html>
Pronto consertei. Amigo, presta atenção no case. Os Id[ô]s de objetos, são case-sensitive, portanto maiúsculas e minúsculas FAZEM DIFERENÇA:
<%@LANGUAGE=[Ô]VBSCRIPT[Ô] CODEPAGE=[Ô]1252[Ô]%>
<!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>
<title> Inserir Contato</title>
<link rel=[Ô]stylesheet[Ô] href=[Ô]styles.css[Ô] type=[Ô]text/css[Ô] />
<script language=[Ô]javascript[Ô]>
function validarCampos () {
if (document.getElementById([ô]txtnome[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Nome![Ô]);
document.getElementById([ô]txtnome[ô]).focus();
return false;
}
if (document.getElementById([ô]txtemail[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Email![Ô]);
document.getElementById([ô]txtemail[ô]).focus();
return false;
}
if (document.getElementById([ô]txttelefone[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Telefone![Ô]);
document.getElementById([ô]txttelefone[ô]).focus();
return false;
}
if (document.getElementById([ô]txtassunto[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Assunto![Ô]);
document.getElementById([ô]txtassunto[ô]).focus();
return false;
}
if (document.getElementById([ô]txtmensagem[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe A Mensagem![Ô]);
document.getElementById([ô]txtmensagem[ô]).focus();
return false;
}
}
</script>
<style>
TD{
font-family:verdana;
font-size:8pt;
}
a{
text-decoration:none;
}
.style1 {color: #000000}
.style2 {font-size: 10pt}
.style3 {font-size: 10; }
.style4 {font-size: 10pt; color: #FFFFFF; }
.style6 {font-size: 10px}
</style>
</head>
<body topmargin=[Ô]0[Ô] rightmargin=[Ô]0[Ô] marginwidth=[Ô]0[Ô] marginheight=[Ô]0[Ô] leftmargin=[Ô]0[Ô] bottommargin=[Ô]0[Ô]>
<table width=[Ô]100%[Ô] cellspacing=[Ô]0[Ô] cellpadding=[Ô]0[Ô] border=[Ô]0[Ô] height=[Ô]100%[Ô]>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô]><table width=[Ô]100%[Ô] cellspacing=[Ô]0[Ô] cellpadding=[Ô]0[Ô] border=[Ô]0[Ô] height=[Ô]100%[Ô]>
<tr>
<td width=[Ô]1[Ô] background=[Ô]images/top_r.jpg[Ô]></td>
</tr>
<tr></tr>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô] background=[Ô]images/line2.jpg[Ô] height=[Ô]2[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/line2.jpg[Ô]></td>
</tr>
<tr>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/last.jpg[Ô] height=[Ô]20[Ô] style=[Ô]color: #652200[Ô] align=[Ô]right[Ô]> </td>
<td width=[Ô]1[Ô] background=[Ô]images/last.jpg[Ô]></td>
</tr>
</table></td>
<td width=[Ô]1[Ô] background=[Ô]images/top_r.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/r_bg.jpg[Ô] height=[Ô]87[Ô] align=[Ô]center[Ô] style=[Ô]font-family: Arial[Ô]><p><img src=[Ô]Topo.jpg[Ô] width=[Ô]970[Ô] height=[Ô]87[Ô]></p> </td>
<td width=[Ô]1[Ô] background=[Ô]images/line1.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô] background=[Ô]images/line2.jpg[Ô] height=[Ô]2[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/line2.jpg[Ô]></td>
</tr>
<tr>
<td background=[Ô]images/bg1.jpg[Ô] width=[Ô]223[Ô] valign=[Ô]top[Ô]><p> </p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</p>
</td>
<td height=[Ô]100%[Ô] valign=[Ô]top[Ô] width=[Ô]565[Ô] style=[Ô]padding-right: 10; padding-left: 10[Ô]>
<BR><p><CENTER><a href=[Ô]../admin.asp[Ô]>MENU</a></CENTER></p><BR>
<form action=[Ô]Inserir.asp[Ô] method=[Ô]post[Ô] name=[Ô]FormInserir[Ô] id=[Ô]FormInserir[Ô] >
<table width=[Ô]528[Ô] border=[Ô]0[Ô]>
<tr>
<td width=[Ô]114[Ô] bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]><p>Nome:</p></td>
<td width=[Ô]398[Ô] class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtnome[Ô] id=[Ô]txtnome[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]60[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>E-mail:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtemail[Ô] id=[Ô]txtemail[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]250[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Telefone:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txttelefone[Ô] id=[Ô]txttelefone[Ô] type=[Ô]text[Ô] size=[Ô]15[Ô] maxlength=[Ô]15[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Assunto:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtassunto[Ô] id=[Ô]txtassunto[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]250[Ô]>
</label>
</span></td>
</tr>
<tr>
<td height=[Ô]46[Ô] bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Mensagem:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<textarea name=[Ô]txtmensagem[Ô] id=[Ô]txtmensagem[Ô] cols=[Ô]55[Ô] rows=[Ô]15[Ô]></textarea>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#FFFFFF[Ô]> </td>
<td><span class=[Ô]style6[Ô]>
<label>
<input type=[Ô]submit[Ô] name=[Ô]Submit[Ô] value=[Ô]Incluir[Ô] onclick=[Ô]return validarCampos();[Ô] >
<input type=[Ô]reset[Ô] name=[Ô]Submit2[Ô] value=[Ô]Cancelar[Ô]>
</label>
</span></td>
</tr>
</table>
<br>
</p>
</form></td>
<td valign=[Ô]top[Ô] background=[Ô]images/bg3.jpg[Ô] width=[Ô]194[Ô] style=[Ô]font: 7pt[Ô]><br>
<div style=[Ô]padding-left: 10; padding-right: 10[Ô]></div></td>
<td width=[Ô]1[Ô] background=[Ô]images/r_bg.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/last.jpg[Ô] height=[Ô]20[Ô] style=[Ô]color: #652200[Ô] align=[Ô]right[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/last.jpg[Ô]></td>
</tr>
</table>
</body>
</html>
<%@LANGUAGE=[Ô]VBSCRIPT[Ô] CODEPAGE=[Ô]1252[Ô]%>
<!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>
<title> Inserir Contato</title>
<link rel=[Ô]stylesheet[Ô] href=[Ô]styles.css[Ô] type=[Ô]text/css[Ô] />
<script language=[Ô]javascript[Ô]>
function validarCampos () {
if (document.getElementById([ô]txtnome[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Nome![Ô]);
document.getElementById([ô]txtnome[ô]).focus();
return false;
}
if (document.getElementById([ô]txtemail[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Email![Ô]);
document.getElementById([ô]txtemail[ô]).focus();
return false;
}
if (document.getElementById([ô]txttelefone[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Telefone![Ô]);
document.getElementById([ô]txttelefone[ô]).focus();
return false;
}
if (document.getElementById([ô]txtassunto[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe o Assunto![Ô]);
document.getElementById([ô]txtassunto[ô]).focus();
return false;
}
if (document.getElementById([ô]txtmensagem[ô]).value == [Ô][Ô]) {
alert([Ô]Por favor, informe A Mensagem![Ô]);
document.getElementById([ô]txtmensagem[ô]).focus();
return false;
}
}
</script>
<style>
TD{
font-family:verdana;
font-size:8pt;
}
a{
text-decoration:none;
}
.style1 {color: #000000}
.style2 {font-size: 10pt}
.style3 {font-size: 10; }
.style4 {font-size: 10pt; color: #FFFFFF; }
.style6 {font-size: 10px}
</style>
</head>
<body topmargin=[Ô]0[Ô] rightmargin=[Ô]0[Ô] marginwidth=[Ô]0[Ô] marginheight=[Ô]0[Ô] leftmargin=[Ô]0[Ô] bottommargin=[Ô]0[Ô]>
<table width=[Ô]100%[Ô] cellspacing=[Ô]0[Ô] cellpadding=[Ô]0[Ô] border=[Ô]0[Ô] height=[Ô]100%[Ô]>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô]><table width=[Ô]100%[Ô] cellspacing=[Ô]0[Ô] cellpadding=[Ô]0[Ô] border=[Ô]0[Ô] height=[Ô]100%[Ô]>
<tr>
<td width=[Ô]1[Ô] background=[Ô]images/top_r.jpg[Ô]></td>
</tr>
<tr></tr>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô] background=[Ô]images/line2.jpg[Ô] height=[Ô]2[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/line2.jpg[Ô]></td>
</tr>
<tr>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/last.jpg[Ô] height=[Ô]20[Ô] style=[Ô]color: #652200[Ô] align=[Ô]right[Ô]> </td>
<td width=[Ô]1[Ô] background=[Ô]images/last.jpg[Ô]></td>
</tr>
</table></td>
<td width=[Ô]1[Ô] background=[Ô]images/top_r.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/r_bg.jpg[Ô] height=[Ô]87[Ô] align=[Ô]center[Ô] style=[Ô]font-family: Arial[Ô]><p><img src=[Ô]Topo.jpg[Ô] width=[Ô]970[Ô] height=[Ô]87[Ô]></p> </td>
<td width=[Ô]1[Ô] background=[Ô]images/line1.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]top[Ô] colspan=[Ô]3[Ô] background=[Ô]images/line2.jpg[Ô] height=[Ô]2[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/line2.jpg[Ô]></td>
</tr>
<tr>
<td background=[Ô]images/bg1.jpg[Ô] width=[Ô]223[Ô] valign=[Ô]top[Ô]><p> </p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</p>
</td>
<td height=[Ô]100%[Ô] valign=[Ô]top[Ô] width=[Ô]565[Ô] style=[Ô]padding-right: 10; padding-left: 10[Ô]>
<BR><p><CENTER><a href=[Ô]../admin.asp[Ô]>MENU</a></CENTER></p><BR>
<form action=[Ô]Inserir.asp[Ô] method=[Ô]post[Ô] name=[Ô]FormInserir[Ô] id=[Ô]FormInserir[Ô] >
<table width=[Ô]528[Ô] border=[Ô]0[Ô]>
<tr>
<td width=[Ô]114[Ô] bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]><p>Nome:</p></td>
<td width=[Ô]398[Ô] class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtnome[Ô] id=[Ô]txtnome[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]60[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>E-mail:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtemail[Ô] id=[Ô]txtemail[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]250[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Telefone:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txttelefone[Ô] id=[Ô]txttelefone[Ô] type=[Ô]text[Ô] size=[Ô]15[Ô] maxlength=[Ô]15[Ô]>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Assunto:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<input name=[Ô]txtassunto[Ô] id=[Ô]txtassunto[Ô] type=[Ô]text[Ô] size=[Ô]60[Ô] maxlength=[Ô]250[Ô]>
</label>
</span></td>
</tr>
<tr>
<td height=[Ô]46[Ô] bgcolor=[Ô]#6666FF[Ô] class=[Ô]style4[Ô]>Mensagem:</td>
<td class=[Ô]style2[Ô]><span class=[Ô]style6[Ô]>
<label>
<textarea name=[Ô]txtmensagem[Ô] id=[Ô]txtmensagem[Ô] cols=[Ô]55[Ô] rows=[Ô]15[Ô]></textarea>
</label>
</span></td>
</tr>
<tr>
<td bgcolor=[Ô]#FFFFFF[Ô]> </td>
<td><span class=[Ô]style6[Ô]>
<label>
<input type=[Ô]submit[Ô] name=[Ô]Submit[Ô] value=[Ô]Incluir[Ô] onclick=[Ô]return validarCampos();[Ô] >
<input type=[Ô]reset[Ô] name=[Ô]Submit2[Ô] value=[Ô]Cancelar[Ô]>
</label>
</span></td>
</tr>
</table>
<br>
</p>
</form></td>
<td valign=[Ô]top[Ô] background=[Ô]images/bg3.jpg[Ô] width=[Ô]194[Ô] style=[Ô]font: 7pt[Ô]><br>
<div style=[Ô]padding-left: 10; padding-right: 10[Ô]></div></td>
<td width=[Ô]1[Ô] background=[Ô]images/r_bg.jpg[Ô]></td>
</tr>
<tr>
<td valign=[Ô]middle[Ô] colspan=[Ô]3[Ô] background=[Ô]images/last.jpg[Ô] height=[Ô]20[Ô] style=[Ô]color: #652200[Ô] align=[Ô]right[Ô]></td>
<td width=[Ô]1[Ô] background=[Ô]images/last.jpg[Ô]></td>
</tr>
</table>
</body>
</html>
Obrigado novamente .
agora tudo funciono, eu estava desatento ou não sabia ... ou sabia e esqueci .... AHUUHauAHUah
Agora todas validações funcionaram ....
Vlw .....
agora tudo funciono, eu estava desatento ou não sabia ... ou sabia e esqueci .... AHUUHauAHUah
Agora todas validações funcionaram ....
Vlw .....
Ocelot obrigado as dicas .....sou nada fanatico por Javascript ainda bem .
só uso algumas mascaras , mensagembox e ou automacao necessaria tipo google mapas.... agora o facebook coisas assim
caso contrario .... mantenho uma boa distancia ..... uhAUHauhAHUauAUH
só uso algumas mascaras , mensagembox e ou automacao necessaria tipo google mapas.... agora o facebook coisas assim
caso contrario .... mantenho uma boa distancia ..... uhAUHauhAHUauAUH
Tópico encerrado , respostas não são mais permitidas