I have a table name courses
courses('course_id','course_name','course_desc')
I am using php. I have 2 rows of record in this table. And I have used a while
loop to list the two as radio button options. I want to add a hidden input field that posts the related course_id
to the course selected in the radio button. What I have right now is.
while($row = mysql_fetch_assoc($result)){
echo '<td><input type="hidden" name="courseid" value="'.$row['course_id'].'"><strong class="panel-title">'.$row['coursename'].'</strong> - '.$row['course_desc'].'<br><input type="radio" name="'.$row['coursename'].'" value="'.$row['coursename'].'"> - Choose '.$row['coursename'].'</td></tr>';
The related hidden input wont get selected when I select 1 of the course. How to achieve that. I hope it would be possible without use of jquery as much as possible.