salut j'ai comme fonction :
et comme code html/php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 if(!DT){ var DT={}; } DT.Checker=function(s){ var el=s.form.elements; for(x=0,y=0;x<el.length;x++){ if(el[x].checked){ y++; } } if(y==0){ alert("vous devrez choisir au moins une valeur"); }};
en fait je voulais verifier si au moins un input est coché
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
18
19
20
21
22
23
24 <form name=\"candidats\" method=\"post\" action =\"candidats.php?type=accept\"> <input type=\"hidden\" name=\"method\"> </tr> "; $sql=$db->query("SELECT c.id AS id, c.maker AS maker,c.fid AS fid,u.name AS name,f.subject AS subject,c.date AS date,c.numero AS numero FROM ".prefix."candidature AS c LEFT JOIN ".prefix."user as u ON (c.maker=u.id) AND (c.id=u.id) LEFT JOIN ".prefix."forum as f ON (c.fid=f.id)",__file__,__line__); while($rs=$db->fetchAssoc($sql)){ echo" <tr class=\"normal\" id=\"row{$rs['numero']}\"> <td class=\"statsTitle\"><input onClick=\"DT.checkRowClass(this,{$rs['numero']},'normal');\" type=\"checkbox\" class=\"none\" name=\"accept[]\" value=\"{$rs['numero']}\"></td> <td><nobr>{$rs['numero']}</nobr></td> </tr>"; } echo" </table> <table align =\"center\"> <tr> <td>{$tmp->button('tout selectionner ',' onClick="DT.checkAllBox(this)"')}</td> </form> <td>{$tmp->button("accept","onclick=\"DT.submitMods(this);DT.Checker(this)\" name=\"approve\"")}</td> <tr> </table>";
mais ça ne marche pas
Partager