<script type="text/javascript">
function insertPreference() {
var row = document.getElementById('voteTable').rows[0];
var cell = row.cells;
var id = cell[0].innerHTML;
var title = cell[1].innerHTML;
alert(id);
alert(title);
}
</script>
<table id="voteTable" border="1">
<tr>
<td id="id">3</td>
<td id="title">This is an example of storing the table value into a database.</td>
<td id="vote">
<input type="radio" name="yesorno" value="true" onclick="return insertPreference()"/>YES
<input type="radio" name="yesorno" value="false" onclick="return insertPreference()"/>NO
</td>
</tr>
<tr>
<td id = "id">12</td>
<td id = "title"></td>
<td id = "vote">
<input type="radio" name="yesorno" value="true" onclick="return insertPreference()"/>YES
<input type="radio" name="yesorno" value="false" onclick="return insertPreference()"/>NO
</td>
</tr>
.
.
.
</table>
I can get the value for id and title. However, I can not get the radio button value.
I will loop through the <tr> tag and access the <td> and pass it to AJAX module in (id + title + value) manner.
Is there a way to do that?