How to configure "SAVE AS" button?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
preza
Forum Newbie
Posts: 2
Joined: Thu Jun 12, 2008 7:24 am

How to configure "SAVE AS" button?

Post by preza »

Hy All,
I'm trying to configure a "Save as" button to save page in html format but it doesn't work like i expected.
Actually I'm using the following code :

Code:
<td align="center" nowrap width="33%"><input type=button value="Save As" onclick="saveasbox('myfilename.htm');"></td>
<script>
function saveasbox (filename)
{
document.execCommand('SaveAs',null,filename)
}
</script>


Someone knows what i'm doing wrong
Thanks,
Preza
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: How to configure "SAVE AS" button?

Post by superdezign »

preza wrote:Someone knows what i'm doing wrong
I barely know what you're doing at all. But, from what my quick Googling has shown, execCommand()'s second parameter should be false, not null. However, I doubt that it makes a difference.
preza
Forum Newbie
Posts: 2
Joined: Thu Jun 12, 2008 7:24 am

Re: How to configure "SAVE AS" button?

Post by preza »

I've tried to change the parameter null to false, but it didn't make difference. :(
Post Reply