javascript - Open/Resize window without a link -
guess trying things not done in javascript not having luck googling it.
i have drop down menu several choices.
when user chooses drop down menu submitted , page reloads. have if statement different things depending on chosen drop down menu.
so if user chooses pdf drop down, want able load new window automatically without having click link when script encounters it.
this works, want same thing without link.
any appreciated.
<a class='link' href="javascript: void(0)" onclick="window.open('print-pdf.php?inv=', 'print', 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); return false;">print</a>
okay, far can tell, you'd use script when user clicks option drop down menu, right?
so, is, on dropdown menu option code, this:
onclick="window.open('hi.html', 'print', 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); return false;"
if menu options created using <li>
tags, this:
<li onclick="window.open('hi.html', 'print', 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); return false;">launch pdf</li>
hope helps.
update:
this may work, server's stuffed can't test php right now:
if($_request["inv"]=="print") { header("location: window.open('print-pdf.php?inv=', 'print','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); return false;"); }
Comments
Post a Comment