1
I’m trying to use bootstrap Alert in a project, but I’m having trouble doing it, what I have at the moment is this:
if (sNome == "" || sTel == "" || sCEP == "" ){ $("p.erro").html("Todos os campos devem ser preenchidos"); return false; } else if ( !(emailFilter.test(sEmail)) || sEmail.match(illegalChars) ){ $("p.erro").html("Por favor, informe um email válido."); return false; }
And I’m displaying the message this way:
<p class="erro" align="center"></p>
But I wish I could show it in this format:
<div class="alert alert-danger">
<strong>Atenção: </strong> Todos os campos precisam ser preenchidos.</div>
In attempting to make such a change to div
of alert
is always visible, I tried to make the change in that way:
$(".alert").html("Todos os campos devem ser preenchidos");
But like you said, it wasn’t right.
Hello @Felipe Nascimento, thanks for the suggestion, I changed the code as indicated, but now the div does not appear with the message.
– adventistapr
Strange, then try to replace the show function by . removeClass("Hidden");
– user59482
Great help @Felipe Nascimento, now worked out, again thanks.
– adventistapr