Hi All,
First post here - so high hopes!

I have created a rollover button that I want to use as a print button in DW MX but when I add Javascript print button code it doesn't work on my rollover. Can it be made to work or is it not possible?

In its single image state it works fine.

Help please...
Thanks

MB

Member Avatar for GreenDay2001

send what have you done till now i mean the code used and i will help you out or tell you where u went wrong

Hi, Thanks for reply - the code is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body><input name="button" type="image" class="NavButton" id="button2" onClick="window.print();" value="Print This Page" src="Images/Strippri.gif">
</body>
</html>

But I need there to be a second image for the button so that it's a rollover which then brings up the Print dialogue box. The second file is "Images/Strippriro.gif" but no idea how to write this into the code to make it work. Any thoughts? For info, The Print code was found on the internet.
Many thanks
MB

Member Avatar for GreenDay2001

i tried it, it didn't work, but when i changed input tag to img it worked. here's the code.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
      function hover(imgName, srcPath)
      {
        document[imgName].src = srcPath;
      }
  </script>
</head>
<body><img name="button" type="image" class="NavButton" id="button2" onClick="window.print();" value="Print This Page" src="image.jpg" onmouseover="hover('button', 'rolloverimage.jpg')" style="cursor: pointer">
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.