2016-10-09 3 views
0

Ich möchte nur fragen, wie im PDF-Format zu drucken und nur den eingegebenen Wert nicht die Textbox oder das Dropdown angezeigt.Nur den eingegebenen Wert drucken

click this link to view the image

ich auch so etwas wie diese angezeigt werden soll, aber wie? Ich hoffe jeder kann mir helfen, danke im Voraus. :)

click this link to view the image

Und schließlich, hier ist mein Code.

<!DOCTYPE html> 
<html> 
<head> 
    <script type="text/javascript"> 
     function printWebpage(t) { 
      t.style.display = "none"; 
      window.print(); 
      t.style.display = "block"; 
     } 
    </script> 
</head> 
<body> 
    <h1>ALQUIZA SURVEYING OFFICE</h1> 
    <h3>CONTRACTUAL PAYROLL</h3> 
    Name: <input type="text" id="name" name="name"/> 
    <br/><br/> 
    Survey: <input type="text" id="survey" name="survey"/> 
    <br/><br/> 
    Payment: 
    <select id="payment" name="payment"> 
     <option>Choose</option> 
     <option>Single</option> 
     <option>Double</option> 
    </select> 
    <br/><br/> 
    Team: 
    <select id="team" name="team"> 
     <option>Choose</option> 
     <option>Team A</option> 
     <option>Team B</option> 
    </select> 
    <br/><br/> 
    <button onclick="printWebpage(this)">Print Webpage</button> 
</body> 
</html> 
+0

Fragen Sie nach [CSS Medienabfragen] (https://developer.mozilla.org/en/docs/Web/CSS/@media)? – germanfr

+0

ja! Ich denke. Haha. –

Antwort

0

Verwendung CSS media queries:

/* Only applied in print mode */ 
@media print { 
    /* Hide or style your elements here */ 
    input[type=text] { 
     border: none; 
    } 
    /* ... */ 
} 

Here is a tutorial, wo Ihr Anwendungsfall erklärt.

Verwandte Themen