Click to See Complete Forum and Search --> : Form buttom with mouseovers


E-Solutions
12-02-2002, 08:06 AM
Hi All I'm trying to do a mouseover for a form buttom and can't seen to get it to work. I can do the mouseover or the buttom but not both. Below is the mouseover Script and the button script. Any help will be great. Is it evern Possible?

Alex
Button Script
<INPUT TYPE="image" NAME="button:s1" src="/myesolutions4u/_uimages/checkit.gif" border="0" ALT="Check IT">

Mouseover Script
<A onMouseOver="if (document.images) document.checkit.src=/_uimages/checkit1.gif';" onMouseOut="if (document.images) document.checkit.src=/_uimages/checkit.gif';"><img src="/_uimages/checkit.gif" width=90 height=21 alt="check it" name="checkit" border=0>



<script language="javascript" type="text/javascript">
<!--
if (document.images) {var checkit=new Image(); checkit.src="http://my.register.com/myesolutions4u/_uimages/checkit1.gif";}
//-->
</script>

AdamGundry
12-02-2002, 11:39 AM
The button element of a form does not have an onmouseover event - I can't tell you why, though.

Your best bet is probably to wrap the button in a <DIV> or <SPAN> and use the event handler on that.

Adam

gil davis
12-02-2002, 04:00 PM
Originally posted by AdamGundry
The button element of a form does not have an onmouseover event

Yes, it does.

<form name="f1">
<input name="i1" id="i1" type="image" src="chksubs.gif" onmouseover="this.src='cancel.gif'" onmouseout="this.src='chksubs.gif'">
</form>

At least in IE 4+, NS 6+ and Mozilla.