3
There is a smarter way to write this verification code, the IF
?
jQuery("#oformulario").submit(function(){
var nome = jQuery("#nome").val();
var email = jQuery("#email").val();
var telefone = jQuery("#telefone").val();
var tipodecontato = jQuery("#tipodecontato").val();
var mensagem = jQuery("#mensagem").val();
var send = jQuery("#send").attr("name");
if(nome != "" && email != "" && telefone != "" && tipodecontato != "" && mensagem != "" && send == "enviar"){
has a small bug, the last field is only = then even not filling it the validation says this true... another difficulty would be with possible non mandatory fields.
– Jader A. Wagner
@Jader well looked after, thank you. I joined too
=$
for strings that end up worthless.– Sergio