Aê meus colegas to precisando de uma ajuda o seguinte gostaria de que meu formulario so fosse enviado se estivesse com todos os campos obrigatorios preenchidos caso contrario isso não acontecece ele ficasse travado na tela ou ate mesmo que passase mas desse mensagem de erro. Segue meu código abaixo: Valeu desde já...... <html><!-- InstanceBegin template="/Templates/geral.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title> titulo da pagina</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="Namo WebEditor v5.0(Trial)">
<script language="JavaScript">
<!--
function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
toolbar_str = toolbar ? 'yes' : 'no';
menubar_str = menubar ? 'yes' : 'no';
statusbar_str = statusbar ? 'yes' : 'no';
scrollbar_str = scrollbar ? 'yes' : 'no';
resizable_str = resizable ? 'yes' : 'no';
window.open(url, name, 'left='+left+',top='+top+',width='+width+',
height='+height+',toolbar='+toolbar_str+',
menubar='+menubar_str+',status='+statusbar_str+',scrollbars=
'+scrollbar_str+',resizable='+resizable_str);
}
function na_window_close()
{
window.close();
}
function na_check_max_length(fname, type_name, str, maxlength)
{
var maxlength;
if (document.forms[fname].elements[type_name].value.length > maxlength) {
alert(str);
return false
}
}
function na_email_validation(fname, type_name, str)
{
var email_validation = true
var temp = document.forms[fname].elements[type_name]
var at = temp.value.indexOf('@')
var prd = temp.value.lastIndexOf('.')
var space = temp.value.indexOf(' ')
var length = temp.value.length - 1
if ((at < 1) || (prd <= at+1) || (prd == length ) || (space != -1)) {
email_validation = false
alert(str)
temp.focus()
}
return email_validation
}
function na_form_validation(fname ,str)
{
var x = 0
var form_validation = true
while ((x < document.forms[fname].elements.length) && (form_validation) ) {
if (document.forms[fname].elements[x].value == '') {
alert(str)
document.forms[fname].elements[x].focus()
form_validation = false
}
x ++
}
return form_validation
}
function na_null_validate(fname, tname, str)
{
f_name = document[fname]
elemnt_name = f_name[tname].value
if (elemnt_name == "") {
alert(str)
return false
}
}
// -->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" vlink="blue" alink="blue" bgcolor="white">
<div align="center">
<table width="676" height="657" border="0" cellpadding="0" cellspacing="0" bordercolor="white" background="fundo_peixes.jpg" namo_layoutbox="10,1,1,10,1,1">
<tr>
<td valign="top" background="file:///H|/images/fundo.gif" width="675" height="656" namo_textbox="0,0,0,0,0,0,0,0,0,0"><div align="left">
<address>
<a href="../index.php"><img src="top_logo.jpg" width="331" height="65" border="0" alt="top_logo.jpg"><img src="top_atendimento.jpg" width="336" height="65" border="0" alt="top_atendimento.jpg"></a>
</address>
</div><div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" background="fundo_peixes.jpg">
<tr>
<td background="fundo_peixes.jpg" height="22" width="672">
<address>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0" width="653" height="30">
<param name="movie" value="barra_menus.swf">
<param name="play" value="true">
<param name="loop" value="true">
<param name="quality" value="high">
<embed src="barra_menus.swf" play="true" loop="true" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="653" height="30"></embed>
</object>
</address>
</td>
</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="0%" bgcolor="#CCCCCC"><div align="left"> </div></td>
<td width="77%"><table width="683" height="531" border="0" cellpadding="0" cellspacing="0" namo_layoutbox="10,1,1,10,1,1" background="fundo_peixes.jpg">
<tr>
<td width="682" valign="bottom" bgcolor="#FFFFFF" height="521" namo_textbox="0,0,0,0,0,0,0,0,0,0" background="fundo_peixes.jpg"><table width="100%" height="286" cellpadding="0" cellspacing="0" background="fundo_peixes.jpg">
<tr> <!-- InstanceBeginEditable name="descricao" -->
<td width="98%" height="474" valign="top" class="texto">
<table width="661" border="0" cellspacing="0" cellpadding="0" height="501" background="fundo_peixes.jpg" namo_layoutbox="10,1,1,10,1,1">
<tr>
<td width="660" height="500" valign="top" namo_textbox="0,0,0,0,0,0,0,0,0,0"> <form name="contato" method="post" action="http://www.site.com.br/cgi-bin/formrobot" style="background-color:rgb(153,255,204);">
<table cellpadding="0" cellspacing="0" border="0" width="657" height="485" background="fundo_peixes.jpg">
<tr height="0" bordercolor="#CCCCCC">
<td width="656" background="fundo_peixes.jpg" height="34" colspan="2" bordercolor="white">
<div align="center">
<p><b><font size="5" face="Arial">Contato</font></b><font face="Arial"> </font></p>
</div>
</td>
</tr>
<tr height="0">
<td width="151" background="fundo_peixes.jpg" height="37" bordercolor="white">
<div align="right">
<p><font face="Arial" color="#009999"><b>Nome</b></font><font face="Arial" color="red"><b>*</b></font></p>
</div>
</td>
<td width="505" height="37" bordercolor="white">
<div align="left">
<address style="line-height:1; margin-top:1; margin-bottom:1;">
<i><font face="Arial" color="#009999"><input type="text" name="Nome:" size="60" OnBlur="na_null_validate('contato', 'Nome:', 'Você têm de Preencher seu nome!');"></font></i>
</address>
</div>
</td>
</tr>
<tr>
<td width="151" background="fundo_peixes.jpg" height="37" bordercolor="white">
<div align="right">
<p><font face="Arial" color="#009999"><b>Empresa</b></font></p>
</div>
</td>
<td width="505" height="37" bordercolor="white"> <div align="left">
<address style="line-height:1; margin-top:1; margin-bottom:1;">
<font color="blue"><input type="text" name="Empresa:" size="60" OnChange="na_null_validate('contato', 'Endereço:', 'Você têm de preencher sua Empresa!');"></font>
</address>
</div>
</td>
</tr>
<tr>
<td width="151" background="fundo_peixes.jpg" height="37" bordercolor="white">
<div align="right">
<p><font face="Arial" color="#009999"><b>Endereço</b></font></p>
</div>
</td>
<td width="505" height="37" bordercolor="white"> <div align="left">
<address style="line-height:1; margin-top:1; margin-bottom:1;">
<font color="blue"><input type="text" name="Endereço:" size="60"></font>
</address>
</div>
</td>
</tr>
<tr>
<td width="151" background="fundo_peixes.jpg" height="34" bordercolor="white">
<div align="right">
<p><font face="Arial" color="#009999"><b>Cidade</b></font><font color="red" face="Arial">*</font></p>
</div>
</td>
<td width="505" height="34" bordercolor="white" background="fundo_peixes.jpg"> <div align="left">
<address style="line-height:1; margin-top:1; margin-bottom:1;">
<font color="blue"><input type="text" name="Cidade :" size="22" OnBlur="na_null_validate('contato', 'Cidade :', 'Por Favor Preencha o Nome da sua Cidade');"></font>
</address>
</div>
</td>
</tr>
<tr>
<td width="151" background="fundo_peixes.jpg" height="37" bordercolor="white">
<div align="right">
<p><font color="#009999" face="Arial"><b>Cep</b></font></p>
</div>
</td>
<td width="505" height="37" bordercolor="white">
<p><input type="text" name="cep" maxlength="8" size="20"></p>
</td>
</tr>
<tr>
<td width="151" background="fundo_peixes.jpg" height="37" bordercolor="white">
<div align="right">
<p><font face="Arial" color="#009999"><b>Estado</b></font><font color="red" face="Arial">*</font></p>
</div>
</td>
<td width="505" height="37" bordercolor="white"> <div align="left">
<address style="line-height:1; margin-top:1; margin-bottom:1;">
<select name="estados" size="1">
<option value="AC - ACRE">AC - ACRE</option>
<option value="AL - ALAGOAS">AL - ALAGOAS</option>
<option value="AP - AMAPÁ">AP - AMAPÁ</option>
<option value="BA - BAHIA">BA - BAHIA</option>
<option value="CE - CEARÁ">CE - CEARÁ</option>
<option value="DF - DISTRITO FEDERAL">DF - DISTRITO FEDERAL</option>
<option value="ES - ESPIRITO SANTO">ES - ESPIRITO SANTO</option>
<option value="GO - GOIAS">GO - GOIAS</option>
<option value="MA - MARANHÃO">MA - MARANHÃO</option>
<option value="MG - MINAS GERAIS">MG - MINAS GERAIS</option>
<option value="MS - MATO GROSSO DO SUL">MS - MATO GROSSO DO SUL</option>
<option value="MT - MATO GROSSO">MT - MATO GROSSO</option>
<option value="PA - PARÁ">PA - PARÁ</option>
<option value="PB - PARAIBA">PB - PARAIBA</option>
<option value="PE - PERNANBUCO">PE - PERNANBUCO</option>
<option value="RJ - RIO DE JANEIRO">RJ - RIO DE JANEIRO</option>
<option value="RO - RODONIA">RO - RODONIA</option>
<option value="RR - RORAIMA">RR - RORAIMA</option>
<option value="RS - RIO GRANDE DO SUL">RS - RIO GRANDE DO SUL</option>
<option value="SC - SANTA CATARINA">SC - SANTA CATARINA</option>
<option value="SP - SÃO PAULO">SP - SÃO PAULO</option>
<option value="SE - SERGIPE">SE - SERGIPE</option>
<option value="TO - TOCANTINS">TO - TOCANTINS</option>
</select>
</address>
</div>
</td>
</tr>
<tr>
<td width="151" background="fundo_peixes.jpg" height="37" bordercolor="white">
<div align="right">
<p><font face="Arial" color="#009999"><b>Telefone</b></font><font color="red" face="Arial">*</font></p>
</div>
</td>
<td width="505" height="37" bordercolor="white"> <div align="left">
<address style="line-height:1; margin-top:1; margin-bottom:1;">
<font color="blue"><input type="text" name="Fone" maxlength="2" size="3" OnBlur="na_null_validate('contato', 'Fone', 'Digite seu DD');na_check_max_length('contato', 'Nome:', 'Digite Seu DD Exemplo : Blumenau 47', 2);"></font>-<font color="blue"><input type="text" name="Telefone" maxlength="4" size="4" OnBlur="na_null_validate('contato', 'Telefone', 'Digite o número do seu Telefone');"></font>-<input type="text" name="fone" maxlength="4" size="4" OnBlur="na_null_validate('contato', 'fone', 'Digite o Número de seu telefone completo');">
</address>
</div>
</td>
</tr>
<tr>
<td width="151" background="fundo_peixes.jpg" height="37" bordercolor="white">
<div align="right">
<p><font face="Arial" color="#009999"><b>E-mail</b></font><font color="red" face="Arial">*</font></p>
</div>
</td>
<td width="505" height="37" bordercolor="white"> <div align="left">
<address style="line-height:1; margin-top:1; margin-bottom:1;">
<font color="blue"><input type="text" name="e-mail" size="44" OnChange="na_email_validation('contato', 'e-mail', 'Seu e-mail está incorreto!');" OnBlur="na_null_validate('contato', 'e-mail', 'Digite seu E-mail');"></font>
</address>
</div>
</td>
</tr>
<tr>
<td width="151" background="writer" height="37" bordercolor="white">
<div align="right">
<p><font face="Arial" color="#009999"><b>Atividade</b></font><font color="red" face="Arial">*</font></p>
</div>
</td>
<td width="505" height="37" bordercolor="white"> <div align="left">
<address style="line-height:1; margin-top:1; margin-bottom:1;">
<font color="blue"><input type="text" name="Atividade" size="44" OnBlur="na_form_validation('contato', '');"></font>
</address>
</div>
</td>
</tr>
<tr>
<td width="151" background="fundo_peixes.jpg" height="98" bordercolor="white">
<div align="center">
<p><font face="Arial" color="#009999"><b>Deixe
sua
Mensagem</b></font></p>
</div>
</td>
<td width="505" height="98" bordercolor="white"> <div align="left">
<address>
<font color="blue"><textarea name="Mensagem" rows="6" cols="68"></textarea></font></address>
<address>
<font color="blue"><input type="submit" name="formbutton1" value="Enviar" OnClick="na_form_validation('contato', 'Verifique se exite campos obrigatorios em branco');na_open_window('win1', 'obrigado.htm', 100, 100, 600, 312, 1, 1, 1, 1, 1);na_window_close();">
<input type="reset" name="Refazer"></font>
</address>
</div>
</td>
</tr>
</table>
</form>
<p> </p>
</td>
<td width="1" height="500"></td>
</tr>
<tr>
<td width="660" height="1"></td>
<td width="1" height="1"></td>
</tr>
</table>
</td>
<!-- InstanceEndEditable --></tr>
</table>
<table width="683" height="31" cellpadding="0" cellspacing="0" class="textobold" border="0" namo_layoutbox="10,1,1,10,1,1">
<tr>
<td width="682" height="30" valign="middle" background="fundo_peixes.jpg" namo_textbox="0,0,0,0,0,0,0,0,0,0"><div align="center"><a href="javascript:window.history.go(-1)"><img src="botao_seta_voltar.gif" width="17" height="17" border="0" align="absmiddle"></a>
7<a href="javascript:window.history.go(-1)" class="linksubmenu">Voltar</a></div></td>
<td width="1" height="30"></td>
</tr>
<tr>
<td width="682" height="1"></td>
<td width="1" height="1"></td>
</tr>
</table></td>
<td width="1" height="521"></td>
</tr>
<tr>
<td width="682" height="9"></td>
<td width="1" height="9"></td>
</tr>
<tr>
<td width="682" height="1"></td>
<td width="1" height="1"></td>
</tr>
</table>
<table width="100%" height="21" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="299" height="24" background="file:///H|/images/barra_fundo.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="textogeralbranco" width="248"> <span class="textofundo">titulo
2003 Copyright</span></td>
</tr>
</table> </td>
<td width="461" background="file:///H|/images/barra_fundo.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" width="371"><div align="right">
<p><a href="http://www.site.com.br" target="_blank" class="textofundo">Developed
by </a><a class="textofundo" href="http://www.site.com.br" target="_blank">empresa</a> </p>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="23%" bgcolor="#CCCCCC"><div align="right"> </div></td>
</tr>
</table>
</div></td>
<td width="1" height="656"></td>
</tr>
<tr>
<td width="675" height="1"></td>
<td width="1" height="1"></td>
</tr>
</table>
</div>
</body>
<!-- InstanceEnd --></html>