mardi 3 mars 2015

checkbox group get value of checked checkbox jquery

Ive been searching for idea on how to get value of checkbox group but i need to the x and y for this so far what i have seen is only with one so i havent really found any relevant answer or idea to my problem so i will explain what i want to happend. In my X i have a number of columns namely first quarter,second quester,third quarter and fourth quarter in my Y i have names of students. And i also have an extra checkbox option to add additional student. I want to Check the check corresponding to names and quarter. I will used this to track down student who has taken the exam and who has not yet taken the exam. I am wondering how to group the the checkboxes in a way that when i check on it will automatically get the student name and corresponding quarter.


HTML:



<tr>
<td width="25%">
<hr/>
</td>
<td width="15%">
<center><span>1st Quarter</span>
</center>
</td>
<td width="15%">
<center><span>2nd Quarter</span>
</center>
</td>
<td width="15%">
<center><span>3rd Quarter</span>
</center>
</td>
<td width="20%">
<center><span>4th Quarter</span>
</center>
</td>
</tr>
<tr>
<td><span>Joe Smith</span>
</td>
<td>
<center>
<input type="checkbox" name="studentrecord[]" />
</center>
</td>
<td>
<center>
<input type="checkbox" name="studentrecord[]" />
</center>
</td>
<td>
<center>
<input type="checkbox" name="studentrecord[]" />
</center>
</td>
<td>
<center>
<input type="checkbox" name="studentrecord[]" />
</center>
</td>
</tr>
<tr>
<td><span>John Smith</span>
</td>
<td>
<center>
<input type="checkbox" name="studentrecord[]" />
</center>
</td>
<td>
<center>
<input type="checkbox" name="studentrecord[]" />
</center>
</td>
<td>
<center>
<input type="checkbox" name="studentrecord[]" />
</center>
</td>
<td>
<center>
<input type="checkbox" name="studentrecord[]" />
</center>
</td>
</tr>




Aucun commentaire:

Enregistrer un commentaire