gif image print button

I use this code to print the main frame on my page:

<form name="PrintA">
<p align="center">
<input type="button" name="PrintB" value=" Print " onClick = "parent.main.focus(); parent.main.print()">
</p>
</form>

I would like a gif image instead of the ugly "button."  Could you please help me fix this code???

Thank you,
Hank
Jeter2ssAsked:
Who is Participating?
 
jarasaCommented:
Hi.

is better to change the image when you pass over with the mouse not when you click on it becose once you click it, you loose the focus and start doing your tag so you wont really se how it changes.

<a href="javascript:your function();" onMouseOver="document.images['name'].src='your imageOn'" onMouseOut="document.images['name'].src='your imageOff'" onFocus="javascript:this.blur();"><img src="Your imageOff" border=0 name="name"></a>

But you should make all this new questions on different ones and assing the points of the one you asked the first time to monvelasquez

Have Fun.
Javier
0
 
monvelasquezCommented:
try this..

<img src="yourimage.gif" onClick = "parent.main.focus(); parent.main.print()">
0
 
Jeter2ssAuthor Commented:
that works, thx monvelasquez!

is there a way to modify that code so that when the user prints the page, the header and footer do not show?  i don't want the address and page numbering to be shown.

thx again
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
monvelasquezCommented:
I'm not sure if that can be controlled using javascript because it's a browser setting.

for example in Internet Explorer, you open up File > Page Setup
you then need to clear up the Header and Footer fields.
0
 
ZontarCommented:
> is there a way to modify that code so that when the user prints the page, the header and footer do not show?

You can keep page elements form being printed by using CSS:

@media print {
  .header, .footer  { display:none; }
  }

>  i don't want the address and page numbering to be shown.

If you're talking about anything added by the browser that's not actually in your pages, there's nothing you can do about that -- it's strictly under user control.
0
 
ZontarCommented:
Also, if you're concerned with older browsers, use

<a href="javascript:parent.main.focus(); parent.main.print();"><img src="yourimage.gif"></a>
0
 
Jeter2ssAuthor Commented:
zontar,

is there a way to make your code change the picture when clicked???
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.