Kod
<thead>
<tr>
<th><input type="checkbox" id="selAll"/></th>
<th>Imię</th>
<th>Nazwisko</th>
<th>Wiek</th>
<th>Wzrost</th>
<th>Atak</th>
<th>Blok</th>
<th>Przyjęcie</th>
<th>Rozgr</th>
<th>Serwis</th>
<th>Technika</th>
<th>Ustaw</th>
<th>Wytrzym</th>
<th>Kondycja</th>
<th>Forma</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" name="players[]" value="5"/></td>
<td>Wit</td>
<td>Zielonka</td>
<td>18</td>
<td>193</td>
<td>2.66</td>
<td>1.04</td>
<td>3.42</td>
<td>3.49</td>
<td>3.74</td>
<td>2.94</td>
<td>2.85</td>
<td>1</td>
<td>9</td>
<td>83</td>
<td><a href="/player/5">Profil</a></td>....
<tr>
<th><input type="checkbox" id="selAll"/></th>
<th>Imię</th>
<th>Nazwisko</th>
<th>Wiek</th>
<th>Wzrost</th>
<th>Atak</th>
<th>Blok</th>
<th>Przyjęcie</th>
<th>Rozgr</th>
<th>Serwis</th>
<th>Technika</th>
<th>Ustaw</th>
<th>Wytrzym</th>
<th>Kondycja</th>
<th>Forma</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" name="players[]" value="5"/></td>
<td>Wit</td>
<td>Zielonka</td>
<td>18</td>
<td>193</td>
<td>2.66</td>
<td>1.04</td>
<td>3.42</td>
<td>3.49</td>
<td>3.74</td>
<td>2.94</td>
<td>2.85</td>
<td>1</td>
<td>9</td>
<td>83</td>
<td><a href="/player/5">Profil</a></td>....
I skrypt w JS, który odpowiada za zaznaczanie wszystkich:
Kod
$("#selAll").toggle(function(){
$("input[name='players[]']").attr("checked",true);
},function(){
$("input[name='players[]']").attr("checked",false);
});
$("input[name='players[]']").attr("checked",true);
},function(){
$("input[name='players[]']").attr("checked",false);
});
Samo zaznaczanie wszystkich działa, tylko że ten checbox sam się nie zaznacza - po jego kliknięciu zaznaczają się wszystkie, oprócz niego :/ Co tu może być nie tak?
</tr>