0
I am beginner in java script and when I run this program if you have the 2 blank fields only the first warning appears but then if you fill the first field the second warning already someone can explain me why and how to fix?
function valida_form (){
if(document.getElementById("adicionanomeparagem").value == ""){
var div = document.getElementById("validacaonomeparagem");
div.innerText = "Não pode estar vazio!"
return false;
}
if (document.getElementById(validacaonomeparagem)!="")
{
document.getElementById("validacaonomeparagem").innerText = ""
}
if(document.getElementById("adicionalatitudeparagem").value == ""){
var div = document.getElementById("validacaolatitudeparagem");
div.innerText = "Não pode estar vazio!"
return false;
}
return true;
}
With your code will only work the last and thank you for your attention
– Tiago Coelho
Try now with the change I made, do even copy->Paste sff
– Pedro Luzio
Try now with the change I made, do even copy->Paste sff
– Pedro Luzio
Remains the same ...
– Tiago Coelho