Bonjour,
J'ai un formulaire avec plusieurs checkbox dont le nombre varie en fonction d'une requête SQL.
Mais checkbox portent le même nom il n'y a que l'ID qui change.
Voici mon formulaire :
Code html : 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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
<form action="AffectCourAR.php"<?php echo $editFormAction; ?>" method="POST"   name="form1" id="form1" >
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
   	  <td width="75"><div align="center" class="texteNormal">Pour Action </div></td>
      <td width="75"><div align="center" class="texteNormal">Pour Info </div></td>
        <td width="10" class="tableau">&nbsp;</td>
      <td width="490" class="tableau"><p align="left" class="tableau">&nbsp;</p>                                      </td>
	</tr>
</table>
<?php do { ?>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
    	<td width="75">
		<div align="center">
        	<input type="checkbox" name="idbureauact[]" id="chkb_1_<?php echo $row_rsBureau['ID_BUREAU']; ?>" onClick="GereControle('chkb_1_<?php echo $row_rsBureau['ID_BUREAU']; ?>', 'chkb_2_<?php echo $row_rsBureau['ID_BUREAU']; ?>', '0');" value="<?php echo $row_rsBureau['ID_BUREAU']; ?>" />
        </div>
        <label for="checkbox"></label>
        <div align="center"></div><div align="center"></div>
		</td>
        <td width="75">
		<div align="center">
        	<input type="checkbox" name="idbureauinf[]" id="chkb_2_<?php echo $row_rsBureau['ID_BUREAU']; ?>" onClick="GereControle('chkb_2_<?php echo $row_rsBureau['ID_BUREAU']; ?>', 'chkb_1_<?php echo $row_rsBureau['ID_BUREAU']; ?>', '0');" value="<?php echo $row_rsBureau['ID_BUREAU']; ?>" />
        </div>
        <label for="checkbox2"></label></td>
        <td width="10">&nbsp;</td>
        <td width="490" class="texteNormal"><?php echo $row_rsBureau['BUREAU']; ?></td>
	</tr>
</table>
<?php } while ($row_rsBureau = mysql_fetch_assoc($rsBureau)); ?>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	  <td width="160"><div align="center"><p>&nbsp;</p></div></td>
        <td width="490"><label>
		<input name="Submit" type="submit" class="texteBouton" id="Submit" value="Enregistrer"/>
		<input name="button" type="button" class="texteBouton" onclick="return annuler();" value="Annuler l'affectation" />
Ce formulaire me permet d'affecter un courrier arrivé à un ou plusieurs bureaux pour action ou pour info.
Après de nombreuses recherches je n'ai pas trouvé de solution afin de tester au submit de mon formulaire si au moins une checkbox portant le nom "idbureauact[]" ou "idbureauinf[]" soit cochée.
Si quelqu'un avait un début de solution ou une piste.
Merci