I want to use jquery to print and here i have a button to perform this taxk but I want this to be printed after the form submission.
here is my code that prints the content on button click event, after printing ti will submit the form.. how can i do this..
<button id="btnjson" type="submit" value="ok" class="button" onclick="printDiv('print-table')">Ok</button>
<script>
function printDiv(divName) {
//alert('s');
var printContents = '<div id="print-content"><form><table width="100%" height="100" ><tbody >';
var inputs, index;
inputs = document.querySelectorAll('input,select');
printContents+='<div style="width:765px; float:left; height:72px;">'
printContents +='</tbody></table>';
w=window.open();
w.document.write(printContents);
w.print();
w.close();
}
</script>