javascript - print popup jquery dialog box -
i need print popup dialog box.i have tried several times,but whole window popup dialog box.i need print dialog box. not around content of dialog box.
here code
view
<script type="text/javascript"> $(document).ready(function(){ $("#dialogbox").dialog({ autoopen:false, modal:true, title: "ndb bank", width:950, height:300, open: function( event, ui ) { } }); $('#submit').click(function() { $('#dialogbox').empty() var $clone=$("#show").clone() $('#dialogbox').append($clone) $('#dialogbox').append("<input type='button' id='submit2' value='save' onclick='myfunction2()'></input>") $('#dialogbox').append("<input type='button' id='print' value='print' onclick='printfunction()'></input>") $("#dialogbox :input").prop("disabled", true); $("#dialogbox #submit2").prop("disabled", false); $("#dialogbox #print").prop("disabled", false); $("#dialogbox #amount_in_words").val($('#amount_in_words').val()); $('#dialogbox').dialog('open'); }); }) </script> <script> function printfunction() { window.print(); } </script> <div id="dialogbox" style="height: 200px ; width: 400px; background-color: #ffa375"> </div> <div id="content"> <div id="show"> <form action="#" id="cheque_details" name="cheque_details" method="post"> <div id="namediv"><p id="namecont">name: <input type="text" id="name"/></p> </div> <div id="datediv"><p id="date">date: <input type="text" id="datepicker"/></p></div> <div id="amountdiv"><p>amount: <input type="text" id="amount" onkeyup="myfunction()" /></p></div> <div id="letamountdiv"><p>amount in letters:<textarea id="amount_in_words" rows="3" cols="30"></textarea></p></div> <p id="addresscont">address: <input type="text" id="address"/></p> <p id="acccont">account no: <input type="text" id="acc_no"/></p> <p id="bank_name">bank: <input type="text" id="bank"/></p> </form> </div>
Comments
Post a Comment