I am onto this problem. During check of the following code in web page, the checkBoxClicked function is called.
<input type="checkbox" name="check" onchange="checkBoxClicked(this)"/>Check
But I sometime need to check this checkbox using php (during editing process). So while I set this check box checked using this code
<input type="checkbox" name="check" onchange="checkBoxClicked(this)"
<?php if($check =='1'){
echo "checked=\"true\"";
}?>
/>Check
I want the function to be called.
What can I do to get the function called when the checkbox is checked using php?
<input type="checkbox" name="check" onchange="checkBoxClicked(this)"
<?php if($check =='1'){
echo "checked=\"checked\"";
}?>
/>Check
<?php if($check == '1'){
echo '<script type="text/javascript">checkBoxClicked(document.getElementsByName("check")[0]);</script>';
}
?>
This would be the quick n dirty solution