Problem:Determine which radio button was sent based on their order and submit the value with jQuery.
HTML table 1 code: - <table class="table table-bordered neutralize" id="itembuttons">
<thead>
<tr>
<th><input type="radio" name="question" id="6" value="6"></th>
<th><input type="radio" name="question" id="7" value="7"></th>
<th><input type="radio" name="question" id="8" value="8"></th>
<th><input type="radio" name="question" id="9" value="9"></th>
<th><input type="radio" name="question" id="10" value="10"></th>
</tr>
</thead>
</table>
Scenario:The above code will generate a POST variable in PHP called "question" that will have a value between 6 and 10 in Table 1. For instance, if I choose 3rd button (value=8) then the value 3 should be set in a hidden input field. If the 5th button was chosen (value=10) then the value 5 should be set in a hidden input field.
Keep in mind that the values can change but the function I am looking for should be generic and look for the number of radio buttons and determine which one was chosen.