I would like to know how I do a form validation so that I do not leave the fields blank on my cell phones, I already did several modes, the pc works but the cell phone did not work anyway, how would I do it?
<script language="JavaScript">
function ValidaSemPreenchimento(form) {
for (i = 0; i < form.length; i++) {
var obg = form[i].obrigatorio;
if (obg == 1) {
if (form[i].value == "") {
var nome = form[i].name
alert("Os campos chave é obrigatório.")
form[i].focus();
return false
}
}
}
return true
}
</script>
<form name="form" id="form" action="send.php" method="post" onSubmit="return ValidaSemPreenchimento(this)">