ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comพัฒนาเว็บไซต์Programmingทำไม Print Text ใน Form เป็น pdf ข้อความไม่มา (มือถือ) มีโค๊ดให้ดู
หน้า: [1]   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: ทำไม Print Text ใน Form เป็น pdf ข้อความไม่มา (มือถือ) มีโค๊ดให้ดู  (อ่าน 1217 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
Fallen
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 162
ออฟไลน์ ออฟไลน์

กระทู้: 2,751



ดูรายละเอียด เว็บไซต์
« เมื่อ: 22 ตุลาคม 2022, 15:22:55 »

หาข้อมูลหลายชั่วโมงมาก ยังไม่เจอวิธีแก้เลยครับ
ใช้กับ PC ได้ แต่กับ มือถือไม่ได้
 wanwan004

โค๊ด:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<body>
<div id="PDF">
<input type="Text" size="27%"/><br>
<input value="m" type="radio">male
<input value="f" type="radio">female<br>
<textarea  name="content" cols="50%" rows="2"></textarea>

</div>
</body>
<button id="print" onclick="printContent('PDF');" >print</button>
<script>
function printContent(el){
var restorepage = $('body').html();
var printcontent = $('#'   el).clone();
$('body').empty().html(printcontent);
window.print();
$('body').html(restorepage);
}
</script>
บันทึกการเข้า

หน้า: [1]   ขึ้นบน
พิมพ์