View Full Version : Fustrating (but simple?!) problem, checking checkboxes

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;
<a href="#" onClick="testScript()">Check</a>

<form name="myform" action="" method="post">
<input type="checkbox" name="mycheckbox" value="1">

Mr J
07-07-2006, 05:13 PM

document.myform.mycheckbox.checked = true;

07-07-2006, 06:19 PM
*bangs head on table*

Thanks :D