Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 <form action="new.php" method="post" target="_self" OnSubmit="return radio_null('num_g')"> <table width="200" border="1" cellspacing="1" cellpadding="1"> <tr> <td>test 1</td> <td>test 2</td> <td>test 3</td> </tr> <?php do { ?> <tr> <td><input type="radio" name="num_g" id="num_g" value="<?php echo $row_suivi['num_g']; ?>"></td> <td><?php echo $row_suivi['nom']; ?></td> <td><?php echo $row_suivi['prenom']; ?></td> </tr> <?php } while ($row_suivi = mysql_fetch_assoc($suivi)); ?> </table>
J'ai créé une fonction en javascript pour tester si un bouton radio est coché ou non. Mon problème est que sur le premier enregistrement cela fonctionne correctement, mais sur les autres lignes ca ne marche plus.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 function radio_null(id_radio) { var radio_null=true; if (document.getElementById(id_radio).checked == false) { alert("Veuillez cocher une case."); radio_null=false; } return radio_null; }
Partager