In my page i am iterating values based on the database table. I have to give a alert message when i check my radio button residing in the php while loop, when users click on it.
I tried the below code, but its not working. When i am clicking on any of the radio button from my page then , i am not getting alert message . Please help me to solve my problem.
my php code:
<?php $result = mysql_query("SELECT * FROM group_expenditure_details where creater_id =
'$uid'");
$a=0;
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td width='20%' align='center'><input type='checkbox'
name='test".$a++."' id='test".$a++."' value='1' /></td>";
echo "</tr>";
}
echo "</table>";
echo "</div>";
mysql_close($con);
?>
My Jquery code:
<script type="text/javascript">
$(function(){
<?php $od=$_SESSION['id']; $result1 = mysql_query("SELECT * FROM
group_expenditure_details where creater_id = '$od'"); $a=0;
while($row = mysql_fetch_array($result1)) { ?>
$('<?php '#test'.$a++?>').click(function(){
<?php } ?>
alert('clicked');
});
});
</script>