wazza103 Posted December 20, 2007 Share Posted December 20, 2007 Hey Got this script working but want it to open in a new window/tab : <form name="htmlMenu"> <select name="htmlSelList" size="1"> <? $file_dir="./Directors/Finances"; $dir=opendir($file_dir); while ($file=readdir($dir)) { if ($file != "." && $file != "..") { echo "<option value=".$file_dir."/".$file." target=_blank>".$file."</a></option>"; echo "<br>"; } } ?> </select> <input type="button" onClick="document.location = document.htmlMenu.htmlSelList.options [document.htmlMenu.htmlSelList.selectedIndex].value;" value="GO"> </form> Anyone know how? Cheers Quote Link to comment https://forums.phpfreaks.com/topic/82495-solved-open-in-new-window/ Share on other sites More sharing options...
chigley Posted December 20, 2007 Share Posted December 20, 2007 Change document.location to window.open Quote Link to comment https://forums.phpfreaks.com/topic/82495-solved-open-in-new-window/#findComment-419347 Share on other sites More sharing options...
wazza103 Posted December 20, 2007 Author Share Posted December 20, 2007 That didn't work... does nothing now Quote Link to comment https://forums.phpfreaks.com/topic/82495-solved-open-in-new-window/#findComment-419348 Share on other sites More sharing options...
beansandsausages Posted December 20, 2007 Share Posted December 20, 2007 FORM> <INPUT type="button" value="New Window!" onClick="window.open(link of new window,'name,'width=400,height=200')"> </FORM> Quote Link to comment https://forums.phpfreaks.com/topic/82495-solved-open-in-new-window/#findComment-419349 Share on other sites More sharing options...
chigley Posted December 20, 2007 Share Posted December 20, 2007 Sorry I wasn't clear enough.. <form name="htmlMenu"> <select name="htmlSelList" size="1"> <? $file_dir="./Directors/Finances"; $dir=opendir($file_dir); while ($file=readdir($dir)) { if ($file != "." && $file != "..") { echo "<option value=".$file_dir."/".$file." target=_blank>".$file."[/url]</option>"; echo " "; } } ?> </select> <input type="button" onClick="window.open(document.htmlMenu.htmlSelList.options [document.htmlMenu.htmlSelList.selectedIndex].value);" value="GO"> </form> Try that! Quote Link to comment https://forums.phpfreaks.com/topic/82495-solved-open-in-new-window/#findComment-419352 Share on other sites More sharing options...
wazza103 Posted December 20, 2007 Author Share Posted December 20, 2007 Cheers for the help... works great now! Quote Link to comment https://forums.phpfreaks.com/topic/82495-solved-open-in-new-window/#findComment-419354 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.