Click to See Complete Forum and Search --> : form input mouseover effect


Beach Bum
12-08-2003, 12:38 PM
Within a form I am using an image as a submit:

<input type="image" name="submit" value="submit" src="send.gif" border="0" alt="Send">

I would like to have a mouseover/mouseout to change the image on rollover. I have tried everything I can think of . . . and have come to the conclusion that changing the src on mouseover must not be supported in a form. But before I give up . . . anyone know of a way?

ray326
12-08-2003, 12:53 PM
This worked fine for me.

<form>
<input onmouseover='this.src="dont_walk_on.gif"'
onmouseout='this.src="dont_walk_off.gif"'
type="image" name="submit" value="submit"
src="dont_walk_off.gif" border="0" alt="Send">
</form>

Beach Bum
12-08-2003, 01:31 PM
I tried every combination of qualifiers in the string (i.e. document.formname.imagename.src) . . . but I never did the easy one "this.src" . . . duh . . .

Thanks ray326 :)

ray326
12-08-2003, 03:30 PM
Because this.src works that means accessing it "remotely" should be document.formname.widgetname.src but I haven't tried that. You can also alter the alt attribute so, e.g., alt could be "Click me now!" during the mouseover.