PDA

View Full Version : JS Help



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>

MrCraig
07-01-2008, 05:56 PM
Couldnt edit,

found and fixed the problem, forgot to give the checkbox field an id and didnt use the style.backgroundColor attrib.

ty anyways.

Want to hide these adverts? Register an account for free!