Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

gif image print button

Posted on 2003-11-17
7
Medium Priority
?
644 Views
Last Modified: 2010-04-09
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
0
Comment
Question by:Jeter2ss
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 3

Assisted Solution

by:monvelasquez
monvelasquez earned 320 total points
ID: 9769086
try this..

<img src="yourimage.gif" onClick = "parent.main.focus(); parent.main.print()">
0
 

Author Comment

by:Jeter2ss
ID: 9769183
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
 
LVL 3

Assisted Solution

by:monvelasquez
monvelasquez earned 320 total points
ID: 9769204
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 11

Assisted Solution

by:Zontar
Zontar earned 320 total points
ID: 9769925
> 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
 
LVL 11

Assisted Solution

by:Zontar
Zontar earned 320 total points
ID: 9769941
Also, if you're concerned with older browsers, use

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

Author Comment

by:Jeter2ss
ID: 9776137
zontar,

is there a way to make your code change the picture when clicked???
0
 
LVL 6

Accepted Solution

by:
jarasa earned 160 total points
ID: 9779622
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question