checking boxes
This is mostly javaScript code but because it is a php website thing I thought you guys may be able to help me. I cant find any good javaScript forms, so please have a look at it.
I am pulling severall rows out of a database and each of them have a checkbox, and I am trying to check them automatically when the page loads up.
function loadCheck3(rowID) {
if ("document.f"+rowID+".b"+rowID+".checked == false")
//alert("document.f"+rowID+".b"+rowID+".checked = true")
eval("document.f"+rowID+".b"+rowID+".checked = true");
}
I then call the function further down in the page for each row that is pulled from the database
><input type=\"checkbox\" value=\"CHECKED\" name=\"b".$row['id']."\" "?>
onMouseover="loadCheck3 (<? echo $row['id'];?>)"
<? echo " ></form>
It works because if I move the mouse over the box it checks it, my problem is is that I want it to check the box automatically when the page loads.
Anyone know how to do this?
I dont want to just write CHECKED in the input tags because i intend to develop this a little further.
I have tried onLoad but it doesnt work unless it is in the body tags
|