Trying to do a rollover image submit button

wxdqz

New Member
First of all, I don't know if this is even possible, but what the heck.

I'm using an image as a submit button
<input type="image" src=http://www.webdeveloper.com/forum/archive/index.php/"images/structure/updatescheme.jpg" onClick="javascript:document.schemestructure.submit();">

and it's the only button on the page that doesn't give visual feedback when the user rolls over it. So I've been trying to cobble up a rollover, including the below attempt to replace the image by putting it in a <span> tag and doing a getElementById/innerHTML swap. But it ain't working.

I admit my javascript skills are a little crusty, so it's entirely possible I just have some bad syntax somewhere, but it's equally possible that this either can't be done (ooh - them's fightin' words!) or it's a bad idea.

Any thoughts from the pros?

function switchschemeimg(value) {
if (value == "on") document.getElementById("updateschemeimg").innerHTML = "<input type=\"image\" src=http://www.webdeveloper.com/forum/archive/index.php/\"images\/structure\/updatescheme-over.jpg\" onClick=\"javascript:document.schemestructure.submit();\">";
else document.getElementById("updateschemeimg").innerHTML = "<input type=\"image\" src=\"images\/structure\/updatescheme.jpg\" onClick=\"javascript:document.schemestructure.submit();\">";
}

<a href="nothing.html" onMouseover="javascript:switchschemeimg(on)" onMouseout="javascript:switchschemeimg(off)"><span id="updateschemeimg"><input type="image" src="images/structure/updatescheme.jpg" onClick="javascript:document.schemestructure.submit();"></span></a>
 
Back
Top