I am using jquery to print the following table. Table has two columns. one for the values and other for the check boxes. Problem I am facing is when I click a checkbox, it is triggering the function which is supposed to be triggered only when the value clicked.
Can somebody tell me how to stop triggering the function when a check box is clicked?
PHP code that prints the table
<table border='1' cellspacing='12' cellpadding='4' style='border-collapse: collapse' width='700' id=topictable >
<?php while ($row = mysql_fetch_assoc($results)) {
$topic = $row['topic'];
?>
<tr bgcolor='white'>
<td class='value'><a href='#'><?php $topic ?></a></td>
<td bgcolor='white'width='5%'><input type=checkbox name=chekboxTopic[] value= <?php $topic ?> </td>
</tr>
<?php
}
?>
</table>
Java script
$(document).on("click","#topictable td", function() {
// to set the session variable`enter code here`
var strSelectedTopic = ($( this ).text());
alert(strSelectedTopic);
var switchval = "setsessiontopic";
var param = "switchval=" + switchval + "&topic=" + strSelectedTopic;
ajaxSend(param);
var form = document.getElementById("abcd");
form.action = "design.php"
form.target = "_blank";
form.submit();
return false;
});