如何从我的文本框中获取值到html表格单元格? [英] How can get the value from my textbox to html table cell?

查看:75
本文介绍了如何从我的文本框中获取值到html表格单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<html>
<head>
<script>
    function printPage(id) {
        var html = "<html>";
        html += document.getElementById(id).innerHTML;

        html += "</html>";

        var printWin = window.open('', '', 'left=0,top=0,width=700,height=700,toolbar=0,scrollbars=0,status  =0');
        printWin.document.write(html);
        printWin.document.close();
        printWin.focus();
        printWin.print();
        printWin.close();
    }
</script>
</head>
<body>
<div id="block1" style="DISPLAY:none;">
<table border="1" width="85%;" height="60%><br" mode="hold" /><tr>
<th colspan="6"></th>
</tr>
<tr>
<th>Employee No.</th><th>& EMP_NO.text</th><th>Permission No.</th><th>111</th><th>Date</th><th>12-09-2014</th>
</tr>
<tr>
<th>Employee Name</th><th>1001</th><th>Grade</th><th>A</th>
</tr>
<tr>
<th>Category</th><th>1001</th><th>Designation</th><th>HR</th>
</tr>
<tr>
<th>Department</th><th>111</th><th> Sub Dept.</th><th>abc</th>
</tr>
<tr>
<th>SubDept-Section</th><th>lmn</th><th>Group/Activity</th><th>kkk</th>
</tr>
<tr>
<th>Remark</th><th>good</th>
</tr>
<tr>
<th>Exception Type</th><th>dd</th>
</tr>
<tr>
<th>Required Date</th><th>12/12/12</th><th></th><th></th>
</tr>
<tr>
<th>Late Type</th><th>drpdwn</th><th>Reorting Time</th><th>1111</th>
</tr>
<tr>
<th>From Time</th><th>1111</th><th>To Time</th><th>1212</th><th>Total Time</th><th>0101</th>
</tr>
<tr>
<th>Approved By</th><th>abvv</th><th>Status</th><th>none</th><th>Remark</th><th></th>
</tr>



</div>



<input type="button" value="Print Block 1" onclick="printPage('block1');"></input>

</body>
</html>
<asp:textbox id=EMP_NO runat="server" CssClass="TextBox_BorderWRO" size="39">
    <asp:Button ID="Button1" runat="server" Text="submit" onclick="Button1_Click" />









如何从我的EMP_NO文本框中获取值到





How can i get the value from my EMP_NO textbox to

推荐答案

var emp_no = document.getElementById("EMP_NO").value;

var txtVal =


(#EMP_NO)。val();
制作< th > id为
< th id = myTH >
("#EMP_NO").val(); Make an <th> with id <th id="myTH">


这篇关于如何从我的文本框中获取值到html表格单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆