emediastudios Posted November 12, 2007 Share Posted November 12, 2007 I wanted to know if there was a php code that i could assign to a button that would open the save as dialog box. I have used some code that i found on the net but i cant seem to get the box to open. This is the code im using. <script language="JavaScript"> var isReady = false; function doSaveAs(){ if (document.execCommand){ if (isReady){document.execCommand("SaveAs");} }else{ alert('Feature available only in Internet Exlorer 4.0 and later.'); } } </script> then i get the button to doSaveAs() I know this is a javascript question but i was unsure if there was a way of doing it with php? Link to comment https://forums.phpfreaks.com/topic/76997-save-as-dialog-button/ Share on other sites More sharing options...
obsidian Posted November 12, 2007 Share Posted November 12, 2007 PHP is entirely server side, so once your page loads, there is no way to run a PHP script without doing an AJAX request of some sort. This, as you've already surmised, is done with Javascript. Link to comment https://forums.phpfreaks.com/topic/76997-save-as-dialog-button/#findComment-389856 Share on other sites More sharing options...
aschk Posted November 12, 2007 Share Posted November 12, 2007 Your isReady variable is false. So it'll never execute the document.execCommand action. Link to comment https://forums.phpfreaks.com/topic/76997-save-as-dialog-button/#findComment-389862 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.