"Lad" <ex****@hope.cz> wrote in message
news:81*************************@posting.google.co m...
I would like to show a dialog window with one input field where a user
can fill in some data and this data ( from this one filed)will be
written to a file.
How can I do that in Javascript?
Thnaks for your help
Lad
Where will the file reside?
If on the server then you'll need to use a technology like ASP (Active
Server Pages).
If on the clien't computer then you can use FSO (FileSstemObject) but it
will issue a security warning.
<html>
<head>
<title>fsoClient.htm</title>
<script language=javascript>
function saveData() {
alert(document.getElementById("Data").value);
var sFIL = "C:\\Temp\\fsoClient.txt";
var oFSO = new ActiveXObject("Scripting.FileSystemObject");
var oCTF = oFSO.CreateTextFile(sFIL, true);
oCTF.write(document.getElementById("Data").value);
oCTF.Close();
}
</script>
</head>
<body>
<form>
<b>Data :</b> <input type="text" name="data" size="50" maxlength="50">
<input type="button" value="Save Data" onclick="saveData()">
</form>
</body>
</html>