Hi,
I was looking for a script that can make a print preview, but I need it to print only specific stuff. Mainly, all i need is for it to not print the submit and print buttons.
Thanks
Josh
Hi,
I was looking for a script that can make a print preview, but I need it to print only specific stuff. Mainly, all i need is for it to not print the submit and print buttons.
Thanks
Josh
ok, but how do you define the specific areas? Do you mean use div id= whatever?
I used this source http://javascript.internet.com/misce...o-preview.html
which has its on print style css, which is good, It can print preview it, but then it just prints the entire page. I made divs with ID=content.
Thanks
josh
That's one way. Alternatively, you could use the class attribute. Even the document hierarchy (how the elements are nested within other elements) if that's sufficient.
Don't. Once again, javascript.internet.com is proving to be a complete waste of bandwidth.I used this source http://javascript.internet.com/misce...o-preview.html
Without a link to your current document, and with a clear indication of what needs to be removed, I can't be too specific.
Mike
I dont suppose you have a good example of this?
O , i understood, i thought there might be an example before you guys looked at it.
I just needed to take out the submit and print button at bottom.
http://wareriver.com/clients/fs/invoice_form.html
Not at the moment, no. There might be a demonstration somewhere on my webspace, but I'm not going to look for it now (it's too late and I'll be going to sleep soon).
As you've placed the controls in a div element, this container can be hidden. First, remove the link and script element that refer to print_preview.css, and delete that file from your Web server. It's junk and if it were tangible, I'd advise you to burn it. Then, change the remaining link element from
to:HTML Code:<link rel="stylesheet" href="form_files/style.css">
and add below that:HTML Code:<link rel="stylesheet" href="form_files/style.css" type="text/css" media="all">
where print.css contains:HTML Code:<link rel="stylesheet" href="form_files/print.css" type="text/css" media="print">
If you discover any other tweaks necessary for printing, insert them into that file.Code:#nav { display: none !important; }
Hope that helps
Mike
ok, thanks for helping me. Unfortunately that does nothing. Am i supposed to change
<input type="button" name="print" value="Print" id="print" onclick="print_preview(); return false;"/>
to something different?
The Print button does not work now.
Thanks, have a good night sleep ^_^
Josh
Doubtful.
Yes, you remove it.Am i supposed to change
<input type="button" name="print" value="Print" id="print" onclick="print_preview(); return false;"/>
to something different?
It's not supposed to. The browser itself will make the changes necessary. Every browser that I can remember using has a print preview function built in, and it will use the print style sheet to determine how to render the document.The Print button does not work now.
Why duplicate functionality that someone else (the browser vendor) already went through the trouble of writing?
Mike
Bookmarks