How to print a web page without the button being printed as well.
Profile blocked
-
Pitet Posted messages 2845 Status Member -
Pitet Posted messages 2845 Status Member -
Hello,
I would like to thank all the forum members for their important help that they provide me every time I need it.
To all PHP programmers, I have a problem with printing my web pages because every time I print by clicking the print button with the function: <input type="submit" name="ok" value="Print" onClick="if(confirm('Do you want to print this form?')){ print();} else{return false;}">
I end up printing the content of the page along with the button; this is incompatible for me and it is even displeasing to the eye of the printout. I don't know what to do at the moment, which is why I really need your help to remedy this problem.
Thanks in advance to everyone.
Configuration: Windows 7 / Firefox 24.0
I would like to thank all the forum members for their important help that they provide me every time I need it.
To all PHP programmers, I have a problem with printing my web pages because every time I print by clicking the print button with the function: <input type="submit" name="ok" value="Print" onClick="if(confirm('Do you want to print this form?')){ print();} else{return false;}">
I end up printing the content of the page along with the button; this is incompatible for me and it is even displeasing to the eye of the printout. I don't know what to do at the moment, which is why I really need your help to remedy this problem.
Thanks in advance to everyone.
Configuration: Windows 7 / Firefox 24.0
2 answers
-
Hi,
Logically, you can define a CSS by type of output, so you should be able to do it for the printer.
https://www.alsacreations.com/tuto/lire/586-feuille-style-css-print-impression.html
You just need to ensure that the button you don't want is hidden by the CSS. -
Hello,
You can define a specific CSS for printing your page. To do this, you need to link a stylesheet to your HTML page by specifying the attribute media="print":<head> ... <link rel="stylesheet" type="text/css" href="ma_feuille_css_imprimante.css" media="print" /> ... </head>
For more details, you can consult this link:
https://www.alsacreations.com/tuto/lire/586-feuille-style-css-print-impression.html