0

hi

I have the following which brings up the print window for my page, however, I would only like to print the "echo" form data which is being displayed and not the entire page.

any suggestions would be greatly appreciated :-)

Thank you

<script>
function printpage()
{
window.print();
}
</script>



<input type="button" value="Print this page" onclick="printpage()" />
4
Contributors
4
Replies
34
Views
4 Years
Discussion Span
Last Post by almostbob
0

Thank you. I have tried adding this, but it dosn't seem to be correct

<style>
@media screen
  {
  .$_POST['telNo']. {font-family:verdana,sans-serif;font-size:14px;}
  }
@media print
  {
  .$_POST['telNo']. {font-family:times,serif;font-size:10px;}
  }
@media screen,print
  {
  .$_POST['telNo']. {font-weight:bold;}
  }
</style>
<script>
function printpage()
{
window.print();
}
</script>

<input type="button" value="Print this page" onclick="printpage()" />

Edited by ultramel

0

you should put first the form inside a div and add a javascript to print only the object inside the div you can search google or other search engine to give you some ideas on how to do it..

0

javascripts may not work, many users block javascript as security issue
css is easier

@media print { .dontprint {display:none;} }
@media screen { .dontshow{ display: none; }}

anthing you dont want to print is 'class="dontprint" '
a set of separate page headers and text to complete a printed page that does not show onscreen is the 'dontshow' class

Edited by almostbob

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.