Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Issue in Mozilla - Please Help

Status
Not open for further replies.

Rich1123

Programmer
Dec 4, 2008
2
US

On this site, if you will notice the button labeled "BUY"

When you mouseover it in IE, Chrome, and Safari it turns red, but it doesn't work in Mozilla for some reason.

<A HREF="javascript:document.myform.submit()" border="0" onmouseover="document.myform.BuyGray21.src='images/BuyButton-Red.jpg'" onmouseout="document.myform.BuyGray21.src='images/BuyButton-Gray.jpg'" onclick="return val_form_this_page()">
<img src="images/BuyButton-Gray.jpg" name="BuyGray21" border="0" width="50" height="18" id="BuyGray21"/></A>

This is the code that I am using. Any help is greatly appreciated!
 
JavaScript error

Code:
document.myform.BuyGray21 is undefined
document.myform.BuyGray21.src = "images/BuyButton-Red.jpg";

It would be better written as

Code:
document.getElementById('BuyGray21').src=

-------------
Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Thanks so much for your help, that worked perfectly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top