BenBox
07-07-2006, 04:59 PM
Hey all!
I've been doing a lot of php coding recently, but have come to the point where I want to add some javascript.. and I'm not having much luck!
I think the blow code explains what I'm trying to do, but where am I going wrong?
I actually had something far more complicated than this (to do more tasks) but I cut it down to this to try and get it working from a very low level, then build it up..
Any help would be greatly appreciated! :D
<script language="Javascript">
<!--
function testScript() {
document.myform.mycheckbox.selected = true;
}
-->
</script>
<a href="#" onClick="testScript()">Check</a>
<form name="myform" action="" method="post">
<input type="checkbox" name="mycheckbox" value="1">
</form>
I've been doing a lot of php coding recently, but have come to the point where I want to add some javascript.. and I'm not having much luck!
I think the blow code explains what I'm trying to do, but where am I going wrong?
I actually had something far more complicated than this (to do more tasks) but I cut it down to this to try and get it working from a very low level, then build it up..
Any help would be greatly appreciated! :D
<script language="Javascript">
<!--
function testScript() {
document.myform.mycheckbox.selected = true;
}
-->
</script>
<a href="#" onClick="testScript()">Check</a>
<form name="myform" action="" method="post">
<input type="checkbox" name="mycheckbox" value="1">
</form>