salve, sono riuscito a fare in modo che di 4 checkbox almeno 1 debba essere "chekkata", ora come faccio a dirgli che SOLO 1 deve essere "chekkata"?
nell'head:
Codice PHP:
<script language="JavaScript">
<!--
function CheckForm() {
var errorMsg = "";
if ((!document.form.REDDITO1.checked)&&(!document.form.REDDITO2.checked)&&(!document.form.REDDITO3.checked)&&(!document.form.REDDITO4.checked)){
errorMsg += "Compila reddito";
alert(errorMsg);
return false;
}
return true;
}
//-->
</script>
le checkbox:
Codice PHP:
<form name="form" method="post" action="prova.php" onSubmit="return CheckForm();">
<input name="REDDITO1" type="checkbox"> Reddito 1
<input name="REDDITO2" type="checkbox"> Reddito 2
<input name="REDDITO3" type="checkbox"> Reddito 3
<input name="REDDITO4" type="checkbox"> Reddito 4
<input type="submit" value="» Prosegui">
</form>
grazie mille in anticipo!