I need help,
how can I make sure that by pressing the "STAMPA" button the page is opened in a new blank page ??? the "STAMPA" page automatically creates a pdf page by script FPDF, but opens above the DV and therefore I am forced to go back with the browser's back button.
It would be more convenient to open new pages and then close it with the X.
ThankYou
$j(function(){
<?php if($selectedID){ ?>
$j('#Servizi_dv_action_buttons .btn-toolbar').append(
'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
'<button type="button" class="btn btn-default btn-lg" onclick="print_servizio()">' +
'<i class="glyphicon glyphicon-print"></i>STAMPA</button>' +
'</div>'
);
<?php } ?>
});
function print_servizio(){
var selectedID = '<?php echo urlencode($selectedID); ?>';
window.location = 'Servizi_stampa.php?id_servizio=' + selectedID;
}
</script>
Print on new Blank Page
Print on new Blank Page
- Attachments
-
- print.jpg (51.82 KiB) Viewed 45399 times
Re: Print on new Blank Page
Hi,
try instead
window.location = 'Servizi_stampa.php?id_servizio=' + selectedID;
try instead
window.location = 'Servizi_stampa.php?id_servizio=' + selectedID;
Code: Select all
var url='Servizi_stampa.php?id_servizio=' + selectedID;
$('<a href="'+url+'" target="_blank"></a>')[0].click();
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Print on new Blank Page
hi, i change my code with this, but when i press the button no action run
Code: Select all
function print_servizio(){
var selectedID = '<?php echo urlencode($selectedID); ?>';
var url='Servizi_stampa.php?id_servizio=' + selectedID;
$('<a href="'+url+'" target="_blank"></a>')[0].click();
}
Re: Print on new Blank Page
Hi,
there is a missing j in my code.
Pls. try
there is a missing j in my code.
Pls. try
Code: Select all
function print_servizio(){
var selectedID = '<?php echo urlencode($selectedID); ?>';
var url='Servizi_stampa.php?id_servizio=' + selectedID;
$j('<a href="'+url+'" target="_blank"></a>')[0].click();
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Print on new Blank Page
Thanks a lot, it works great