Hide buttons of a document while printing in web

Hello,

i would like to hide all the buttons which are located in the top of my document when i click on a ‘print’ button in web.

i made a print button with the javascript code :

document.forms[0].HideButton[0].checked=true;

window.print();

the document is printed but the buttons aren’t hidden although the HideButton got the new value ‘Yes’.

HideButton is a radio field with ‘Yes’ or ‘No’ and all my buttons got the clause "HideButton=“Yes” in the hide section.

I think i have to refresh the document before printing it, but i don’t know how to do it in Javascript.

thanks for your help

Stef

Subject: hide buttons of a document while printing in web

Stef,I don’t know if you ever found a solution to this, but there is a way that this can be done without having to write a single line of Javascript! I had to do a similar thing for one of my applications.

If you’re familiar with CSS, you can create a style-sheet that will only be applied when the screen is being printed, and apply it to the elements that you want shown or hidden. I won’t get into all of the specifics here, but feel free to e-mail me, and I can send you some code examples.

-Danny

Subject: RE: hide buttons of a document while printing in web

Danny - Next time, please give the solution… :stuck_out_tongue:

Stephane (or more likely others who come later),

I was able to hide my buttons using CSS.

A quick sample follows, two styles for the same class, one for media=“screen” and the other for media=“print”


.myButton { background-color: #CBDBEA; padding: 0px 5px 1px 5px; margin: 0px 2px 0px 2px; height: 11px; border-style: outset; border-width: 2; white-space:nowrap; cursor: hand; } .myButton { display: none; }

The button(s) have the “myButton” class assigned and will not be shown when the web page is printed.

Cheers,

Mark Crosby

Subject: RE: hide buttons of a document while printing in web

Mark, I appreciate your response from last year. I’m having a hard time trying to get this to work in Notes. Can you email me with the exact placement of all these elements in Notes. Just make it for a single button on the form or action bar that I want to hide when printing. What text do I put in the HTML tab and/or header, etc.? My email is epi@enviroprointl.com. Thanks Mark.

Mike