i have a textarea and two buttons
like
<form name="form1">
<textarea name="text1"> HTML Codes goes here </textarea>
<input type="button"> Open File
<input type="button"> Save File
</form>
when i click on "save" button i want the text in textarea to be saved (i want it to pop up the "save as" dialog box)
When i click on "open" , it should allow me to choose any html or textfile... and load the text in the textfile/htmlcode into my textarea.
Found this code in http://www.dynamicdrive.com/forums/archive/index.php/t-10532.html
<html>
<head>
</head>
<body>
<script language="javascript">
function WriteToFile()
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("C:\\NewFile.txt", true);
var text=document.getElementById("TextArea1").innerText;
s.WriteLine(text);
s.WriteLine('***********************');
s.Close();
}
</script>
<form name="abc">
<textarea name="text">FIFA</textarea>
<button onclick="WriteToFile()">Click to save</Button>
</form>
</body>
</html>
this would work if it porvides the user the choice to save the file ...and i forgot to say that all files are in the client computer.
Thanx in Advance
-Miss Subanki