Hello,
I have created an exercise on which one column has words and the second column has the pronounce.
The second column is shuffled.
The code which shows the results is:
while($row = pg_fetch_array($ideo_results)){
$pinyin_query = "select id, pinnin from temp_match where ideogram = '".$row['ideogram']."'";
$pinyin_results = pg_query($cn, $pinyin_query);
while($line = pg_fetch_array($pinyin_results)){
echo "<tr>
<td><input id='getIdeo' type=radio name='ideogram' value='".$row['ideogram']."'>".$row['ideogram']."</td>
<td><input id='getPin' type=radio name='pinnin' value='".$line['pinnin']."'>".$line['pinnin']."</td><td><div id=results></div></td>";
}
}
I change the code and I made them as radio buttons.
I use jquery to post it on another PHP page for check BUT I cannot get the values from the selected radio buttons, but only the 2 first values.
What I have tried:
function quiz() {
var getIdeo = $("#getIdeo").checked.val();
var getPin = $("#getPin").checked.val();
$.post("match_check.php", { getIdeo: getIdeo, getPin: getPin },
function(data) {
$('#results').html(data);
$('#myForm')[0].reset();
});
}
<input type='button' id='check_quiz' onclick='quiz()' value='Check'>