Hey I need a little help with a form and javascript problem I am having.
I have a checkbox and button in a form, I want the button to be disabled if the checkbox isnt ticked/checked.

I have managed to get this working so that the user checks the checkbox and the button is enabled, but if the user checks and then unchecks the checkbox the button is still enabled. Is there an opposite to the function onClick? or maybe the use of an if statement will fix this problem..
Your help is much appreciated..

The code I am using for the form is below.
Code:
<form method="post" action="public" enctype="multipart/form-data" id="upload_form" onsubmit="return doSubmit()">
    <input type="hidden" name="action" value="upload" />

...unrelated code in here....

<li><input type="file" name="file_1" size="60" /></li>
<li><input type="file" name="file_2" size="60" /></li>
<li><input type="file" name="file_3" size="60" /></li>

<input name="agreecheck" type="checkbox" onClick="enableSubmitButton()"><b>I agree to the above terms</b><br>
	<input type="submit" class="blue_button" id="submit_button" value="Upload selected files" />
</form>
And the jave script code I am using
Code:
function doSubmit()
{
    if(!upl.getSelectedCount()){alert('You did not select any files.');return false;}
	var submit_button = $('submit_button');
	submit_button.value = 'Uploading files, please wait...';
	submit_button.disabled = true;
    return true;
}
function disableSubmitButton ( )
{
	var submit_button = $('submit_button');
	submit_button.value = 'Agree to Terms of Service';
	submit_button.disabled = true;
}
function enableSubmitButton ( )
{
	var submit_button = $('submit_button');
	submit_button.value = 'Upload selected files';
	submit_button.disabled = false;
}
addLoadEvent(disableSubmitButton);