Hello my question is that in what way can I validate that for the case that there is no combobox selected, throw an error.
Normally it is the other way around with the validations, where it is asked that there be at least one or several comboboxes selected, or text boxes or some variable, and then continue with the sending of the form, asking if the string is empty or not and commonly is for some specific control, which is identified by the name or id of a particular object.
The following example I have shows a bit to what I mean:
<script language="JavaScript"> /*NOTA:Los mensajes del alert no son importantes*/
function validaSelects(){
if (document.formAlertas.RutaAl.value == "")
{
alert("No sea pillo. Seleccione una opción");
return false;
} else if(document.formAlertas.UsuariosA.value == "" )
{
alert("Segunda Advertencia, debe seleccionar una opcion.");
return false;
}
else if (document.formAlertas.RegionA.value=="")
{
alert("Tercera Advertencia, deberá seleccionar una opción.");
return false;
}
else if (document.formAlertas.ClientesA.value=="")
{
alert("Se lo advertimos ya no podrá continuar");
return false;
}
else{
document.formAlertas.submit();
}
}
</script>
This example I did trying to achieve the final purpose, what it does is ask if any of those combobox was selected and then throw an error for each combobox that has not been selected.
Another way that I tried was that I put the first 2 combobox together and compared them with an OR, then with a yes-no I asked for the next 2 combobox and I also compared them with || and for each comparison he sent an error message, which was not what he was looking for as a final purpose either.
But indistinctly what I said at the beginning what I want to do is something completely different, the purpose is to do a validation where the error throws it as long as there is no no combobox selected, and then the case that there is At least 1 combo selected ( Anyone ) continue with the submission of the form. I hope with javascript, which is what I've been trying and it's simpler.