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 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 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 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> 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! 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! 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
Archived
This topic is now archived and is closed to further replies.