MrCraig
07-01-2008, 05:19 PM
Anyone know whats wrong with my function (ie when a box is checked, the bgcolor of the row changes..
Its just showing JS error and nothing happens :(
<script type="text/javascript">
function turn(id)
{
var check = "f" + id;
var rowid = "r" + id;
if(document.form.getElementById(check).checked = false)
{
//The box has been unchecked
document.form.getElementById(rowid).bgcolor = "#FFFFFF";
}
else
{
//The box has been checked..
document.form.getElementById(rowid).bgcolor = "#CCFFFF";
}
}
</script>
Its just showing JS error and nothing happens :(
<script type="text/javascript">
function turn(id)
{
var check = "f" + id;
var rowid = "r" + id;
if(document.form.getElementById(check).checked = false)
{
//The box has been unchecked
document.form.getElementById(rowid).bgcolor = "#FFFFFF";
}
else
{
//The box has been checked..
document.form.getElementById(rowid).bgcolor = "#CCFFFF";
}
}
</script>