title: Trouble in printing a div content with text fields using javascript?
body: <p>This is the div which i have been print.</p>
  
  <pre><code>&lt;div id="leftdes"&gt;In order to purchase and obtain a copy of your certified IRS Transcript for the year &lt;/strong&gt;
    &lt;div&gt;
      AUTHORIZED SIGNATURE ________________________________ 
      &lt;input title="Enter Date" name="aut_date" id="aut_date" type="text"  value="" onClick="rem_valid(this.id);"/&gt;
    &lt;/div&gt;
    &lt;div class="search-raw" style="width:98%;"&gt;
      &lt;select title="Select Suffix" name="a_suff" id="a_suff" class="input-4" style="padding:5px;" onClick="rem_valid(this.id);"&gt;
        &lt;option value="" selected="selected"&gt;SUFFIX&lt;/option&gt;
        &lt;option value="Jr"&gt;Jr&lt;/option&gt;
        &lt;option value="Sr"&gt;Sr&lt;/option&gt;
        &lt;option value="I"&gt;I&lt;/option&gt;
        &lt;option value="II"&gt;II&lt;/option&gt;
        &lt;option value="III"&gt;III&lt;/option&gt;
      &lt;/select&gt;
    &lt;/div&gt;
    &lt;input title="Enter Company Name" name="a_cname" id="a_cname" type="text"  value="" onClick="rem_valid(this.id);"/&gt;&lt;/br&gt;&lt;/br&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I am trying to print the above <strong>div</strong> using javascript code below. But iam not getting the values of input fields. Help me to getout of this problem.</p>
  
  <pre><code>function printdiv(divid)
  {
    var divElements = document.getElementById(divid).innerHTML;
    //var name="US Background Check";
    var oldPage = document.body.innerHTML;
    var current=document.body.innerHTML = "&lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;img src='images/logo.png'/&gt;&lt;/br&gt;"+divElements+"&lt;/body&gt;";
    window.print();
    document.body.innerHTML=oldPage;
  }
  </code></pre>
  
  <p>Print function "printdiv" called when click on this below button.</p>
  
  <pre><code>&lt;input name="but" id="but1" type="button"   value="PRINT"  onClick="printdiv('leftdes');"/&gt;
  </code></pre>