title: Trapping CTRL + P in javascript and calling a custom function for printing
body: <p>I have a webpage where i show billing information in a pop. This popup is a DIV and not an new window.
  In that popup there are two div's one is to hold the print and close button
  and the other is to hold an iframe.</p>
  
  <p>Then reason is when the print button is clicked the content of the iframe is printed so that the print and close buttons will not get printed. it is like...</p>
  
  <pre><code>&lt;div id='popupandcenterscreen'&gt;
  &lt;div&gt;... print and close buttons&lt;/div&gt;
  &lt;div&gt;&lt;iframe&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So, it is a listing where each entry has a bill link when clicked the popup is displayed in which an iframe is loaded to display the billing information.</p>
  
  <p>When user clicks the print button we are printing only the document content of the iframe.</p>
  
  <p>BUT WHEN THE USER USED CTRL + P the total window including the backgroung parent window and this popup div gets printed.</p>
  
  <p>what i thought was to trap ctrl+p when the popup is open and to print only the iframe content.</p>
  
  <p>How could that be possible?</p>