
November 15th, 2004, 02:07 PM
|
|
|
|
Join Date: Apr 2007
Location: Edinburgh, UK
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Buttons
Hello all,
I have been trying to get a submit button to work as an image with a rollover with some javascript doing some of the work. I have two ways of doing this. One is using a proper button with a graphic but the rollover does not work but the script does and is this:
<input name="searchbutton" type="image" src="images/button-search-up.gif" value="Search" onclick="javascript:parent.passTextIE(this.form.criteria.va lue);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('searchbutton','','images/button-search-down.gif',1)">
The other way is using a a href link where the rollover works but the javascript does not work. This is shown here:
<a href="javascript::parent.passTextIE(this.form.criteria.v alue);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('name1','','images/button-search-down.gif',1)"><img src="images/button-search-up.gif" name="name1" width="106" height="40" border="0"></a>
The javascript being executed copies info to a iframe and submits a form on there. Here is the javascript:
top.frames['searchList'].document.frmsubmit.searchcriteria.value = str;
document.searchList.frmsubmit.submit();
Anybody know how I can get this script to work but with a rollover image. Hope this make sense!
Cheers
Dorian
|