|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to perform an image swap in a form using the input type of 'image'. For some reason, onmouseover or onmouseout does not work when I assign it different images:
<form onsubmit="window.open('weblink.html')"> <input name="image1' type=image src="image.jpg" border=0 onclick="submit()" onmouseover="document.image1.src="imagealt.jpg" onmouseout="document.image1.src="image.jpg"> </form> I have tried using onmouseout/onmouseover in various combinations to achieve the effect and it only seems to work OUTSIDE of the form tags. Can anyone offer any useful advice? |
|
#2
|
|||
|
|||
|
a couple of things:
make sure you keep your single and double quotations straight. if you embed javascript, call it first by saing javascript: and then the stuff you want. <form onsubmit="window.open('weblink.html')"> <input name="image1" type="image" src="image.jpg" border=0 onclick="submit()" onmouseover="javascript:document.image1.src='imagealt.jpg';return true;" onmouseout="document.image1.src='image.jpg'; return true;"> </form> see if that works, otherwise move the rollover to a function and call that function. -b |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > image swapping in forms? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|