Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save from textarea

Status
Not open for further replies.

benclinch

Programmer
Aug 13, 2006
8
GB
Hey!

How can I make a document where I have a textarea, and a save as button. When they click the button it comes up with a standard save as dialog. Probably to save a .txt file. I will save everything in the text area.

Thanks alot,

Ben
 
You won't be able to reliably do this cross-browser / cross-OS. You can probably do it in IE using execCommand, but that's IE-only, so not really suited to internet apps.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks for replying, is there any way I can do it so that instead of "Save As", it will ask to download it? I suppose this would be even better!

Thanks in advance.

Ben
 
i suggest doing this with server-side code, such as PHP, ASP, JSP, ColdFusion, the list goes on. these languages are really more competent in file writing, and do not rely on certain operating systems, browsers, or enabling of javascript.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top