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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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.