function enviar(form) { var message = ""; var textoBusqueda = document.getElementById("buscar").value; var idFamilia = document.getElementById("familia_buscar").value; if ((idFamilia == null || idFamilia == '') && (textoBusqueda == null || textoBusqueda == '')) { message = "Al menos uno de los campos de entre 'Familia Profesional' o 'Texto a buscar' debe estar informado."; } if(message == "") { var patron = /^".*"$/; var cumplePatron = true; var cumpleValidicacion = false; if (patron.exec(form.textoBusqueda.value) && form.textoBusqueda.value.length < 5) { alert("El campo 'Texto a Buscar' no puede tener menos de 3 caracteres, sin incluir las comillas."); cumplePatron = false; } cumpleValidacion = validateBusquedaAcreditacionesForm(form); return cumplePatron && cumpleValidacion; } else { alert(message); return false; } }