Como não enviar campos em branco no Formulário

<html> <head> <script type=”text/javascript”> ValidarFormulario = function(f){ var msgErro=””; var result=true; if(!f[“nome”].value) msgErro+=”Nome; “; if(!f[“email”].value) msgErro+=”Email; “; if(!f[“assunto”].value) msgErro+=”Assunto; “; if(!f[“mensagem”].value) msgErro+=”Mensagem; “; if (msgErro){ alert(“Faltam preencher os seguintes campos: nn”+msgErro); result=false; } return result; } </script> </head> <body> <form method=”post” onsubmit=”return ValidarFormulario(this);”> Nome <input type=”text” name=”nome” id=”nome”><br> Email <input type=”text” name=”email” id=”email”><br> Assunto <input […]

Como não enviar campos em branco no Formulário Read More »