i have some dynamic radio button, now my problem is how can i detect which radio button is selected/clicked and how can i get the selected radio button’s value ??
my code:
<div class="well sidebar-nav rbatch">
<ul class="nav nav-list">
<li class="nav-header">
<?php
include 'connect.php';
$result = mysql_query('select * from batches');
$index=0;
while($row=mysql_fetch_array($result))
echo "<label class='radio'>
<input type='radio' id='".$index++."'> Check me out
</label>"
?>
</li>
</ul>
</div>
http://jsfiddle.net/ctFt7/
Your radio button must all have the same name so that at any one time, only 1 button can be selected.