Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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" />




How can i get the value from my EMP_NO textbox to
Posted
Updated 19-Apr-14 1:18am
v2

JavaScript
var emp_no = document.getElementById("EMP_NO").value;
 
Share this answer
 
v2
Comments
Member 9410081 21-Apr-14 3:08am    
I want to assign this value to <th>
Did you try anything for that?
Member 9410081 22-Apr-14 0:30am    
yes.
And what is that?
XML
var txtVal = $("#EMP_NO").val();
Make an <th> with id
<th id="myTH">
$("#myTH").val(txtVal);



In JQuery
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900