<form id="contact-form">
<input type="text" name="nome" placeholder="Nome*:" value="" class="required" />
<input type="text" name="telefone" placeholder="Telefone*:" value="" class="required" />
<input type="text" name="email" placeholder="Email*:" value="" class="required" />
<button type="submit" id="enviar" name="submit">Concluir Cadastro</button>
</form>
Js:
$("#contact-form").submit(function(){
event.preventDefault();
var dados = $(this).serialize();
var campos = $(this).find('.required');
$(campos).each(function() {
for(i=0; i=$(this).val() == ''; i++ ){
if( $(this).val() == '' )
{
alert("Preencha os campos obrigatórios");
$(this).focus();
e.preventDefault();
}else {
$.ajax({
type: "POST",
url: "cadastrar.php",
data: dados,
success: function(data)
{
$("#status").slideDown();
$("#status").html(data);
}
});
$('#contact-form').trigger("reset");
}
}
});
});
JSFiddle: link