// Javascript para el formulario de contacto. function ValidarForm() { error = false if(document.getElementById("campo1").value == "") { InvalidarCampo("1"); error = true; } if(error == true) { return (false); } else { return (true); } } function InvalidarCampo(id) { if (id == 'campoMail') { id = 2; } document.getElementById("campo" + id).className = "txt-error"; } function VerificarCampo(id) { if(document.getElementById("campo" + id).value != "") { document.getElementById("vacioCampo" + id).style.display = "none"; document.getElementById("campo" + id).className = "txt"; } else { document.getElementById("vacioCampo" + id).style.display = "inline"; } }