Disable Image Submit Button Script

I’m trying to use the script below to disable an image submit button. For some reason it isn’t working. Does anybody see what’s wrong with it?

// this goes in the anchor tag for the submit imageonclick="var obj=disable(this);"
// this goes in the form tag
onsubmit="return disablebutton(obj);" 
// this goes in the head tag
function disablebutton(obj){

You can use this

<input name=“img” type=“image” src=“images/image.jpg” id=“button” onsubmit=“this.disabled = ‘true’;”>


<input name=“submit” type=“submit” id=“button” onsubmit=“this.disabled = ‘true’;”>

so the disabled effect only appears in te second case