I have the following CSS associated with a div that I used, to show a message to the user, when a form does not fill in any field or introduce erroneous data:
CSS Code:
#informacion {
padding-left:20px;
background-repeat:no-repeat;
background-position: 5px center;
color:#00793d;
padding:5px;
padding-left:25px;
background-color:rgba(200,150,200,0.2);
border-radius:2px;
margin:15px;
display:none;
}
HTML Code:
<div id="informacion" class="linea_formulario"></div>
Example of using the "information" div:
document.getElementById("informacion").innerHTML = "EL CAMPO "+formulario.elements[i].name+" NO PUEDE ESTAR VACÍO.";
Due to the attribute " display:none
" is blocked / hidden.
Can it be unlocked using Javascript code or should the CSS code be touched? Obviously removing the "display: none" property makes it visible and works as expected by displaying the message.