I am developing a billing system using codeigniter - mysql. I would like to print invoice using window.open() of JavaScript . My code is like below


function invoice()
var wind = window.open('','_blank','width=700,height=700,scrollbars=yes,status=yes');

var html = '<input type="button" id="submit_button" onclick="print_invoice();" value="Submit"/>';



I would like to attach a function in the input button id="submit_button" to save the invoice in database.

Could any one say how can I do that?