Bonjour a tous
Je suis en train de faire un formulaire de commentaire type allocin� avec un syst�me d'�toiles. mes �toiles sont des checkbox dont j'ai modifi� le css mais seulement quand je clique sur une �toile celle ci change bien de couleur mais la checkbox associ�e ne se coche pas....
Voici mon code:
en r�alit� c'est mon
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112 <html> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <head> <style type='text/css'> label.checkbox_checked { background: white url('StarOver.gif') no-repeat; padding: 25px 25px 25px 25px; font-family:verdana; font:20px; display: block; margin: 0px; } label.checkbox_unchecked { background: white url('StarOut.gif') no-repeat; padding: 25px 25px 25px 25px; font-family:verdana; font:20px; display: block; margin: 0px ; } </style> <script> function Warp(obj){ obj.className=(obj.className=='checkbox_checked')?'checkbox_checked':'checkbox_checked'; mycheck=document.getElementById('checkbox_1') mycheck.checked=!mycheck.checked } function Warped(obj){ obj.className=(obj.className=='checkbox_unchecked')?'checkbox_unchecked':'checkbox_unchecked'; mycheck=document.getElementById('checkbox_1') mycheck.checked=!mycheck.checked } </script> </head> <body> <form name="form" action="resultat.php" method="post"> <table> <tr> <?for ($i=0;$i<10;$i++){?> <td><label id="label_<?echo $i;?>" class="checkbox_unchecked" onclick=" <? for ($j=0;$j<($i+1);$j++){ ?> Warp(label_<?echo $j;?>) <? } for ($j=$i+1;$j<10;$j++){ ?> Warped(label_<?echo $j;?>) <? } ?> "></label> checkbox<?echo $i+1;?>:<input name="checkbox<?echo $i+1;?>" id="checkbox_1" type="checkbox" /></td> <?} //style='z-index:10;visibility:hidden;' ?> </tr></table> <table><tr><td> Commentaires: </td><td><TEXTAREA rows="3" name="commentaires"> Tapez ici vos commentaires</TEXTAREA></td></tr></table> <br><input type='submit' value='poster'> </form> </body> </html>
mycheck=document.getElementById('checkbox_1')
mycheck.checked=!mycheck.checked qui ne marchent pas mais je ne comprend pas pourquoi...
Partager