Verification de Checkbox (PHP) avec JavaScript
Bonjour à tous je voulais savoir comment faire pour vérifier une liste de bouton radio.
Pour etre claire :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
echo'<form name="choix" method="POST" action="valider" onSubmit='return verif_choix()' >';
while ($tab=mysql_fetch_array($RqExe))
{
extract($tab);
echo"<input type='radio' name='produit'
value='$tab[0]'> $tab[1]";
}
echo"</br>";
echo"<input type='submit' value='Séléctionner'>";
echo"</form>";
}
<script type="text/javascript">
function verif_choix()
{
if(document.choix.senar.value == "") {
alert("Séléctionner un produit.");
return false;
}
}
</script> |
Mais je voudrais tester qu'un des choix soit coché.