Person, beauty? So, I have an alert div (that of the bootstrap) with the display none and visibility hidden I'm catching it by id, both in css and javascript, but it does not work. It changes the properties of the CSS but still sends the data to PHP, the validation is not worth anything haha. Help me please. this is one of the inputs I want to validate.
<input type="text" name="pergunta" data-placement="bottom" class="form-control" placeholder="Ex: XXXXXXXXXX?" aria-describedby="basic-addon1">
This is the div that I put as hidden by default, it is positioned below the input:
<div class="alert alert-danger" id="valida_pergunta" role="alert"><span class="glyphicon glyphicon-info-sign"></span> Preencha o campo Pergunta</div>
When I click, I want it to display the div that looks like hidden and does not send anything to PHP.
function validar (){
var pergunta = form_pergunta.pergunta.value;
var resposta = form_pergunta.resposta.value;
var desafio = form_pergunta.desafio.value;
if(pergunta==""){
document.getElementById("valida_pergunta").style.display = "flex";
}
if (resposta == "") {
document.getElementById("valida_resposta").style.display ="flex";
}
if (desafio ==""){
document.getElementById("valida_desafio").style.display = "flex";
}
}