hey,
I have been trying to set a variable in this activex script i got a while back from lrnmore a resident here...
I can't seem to get it right...I am hoping someone could add to my code:
a prompt box that asks the user: Name of file and extention?
the user would then type: someThing.txt (could be any name or ext)
and the text in the textarea would be saved as someThing.txt.
here's my code:
again,
I am trying for a prompt box that asks the user what to name the file that is getting ready to be saved, which is the text in the textarea...to do this I would like to set a variable and place it in place of the "MyText.txt" string...
that way whatever name/ext the user types in the prompt box will be the name/ext the file is saved as... instead of how it is now defaulting to my pre-defined name/ext "MyText.txt"
thanks
co
I have been trying to set a variable in this activex script i got a while back from lrnmore a resident here...
I can't seem to get it right...I am hoping someone could add to my code:
a prompt box that asks the user: Name of file and extention?
the user would then type: someThing.txt (could be any name or ext)
and the text in the textarea would be saved as someThing.txt.
here's my code:
Code:
<script>
function strtxt1(txt){
var strObj = new ActiveXObject('Scripting.FileSystemObject');
var strFile = strObj.OpenTextFile('MyText.txt', 2, true);
if(!txt) {
txt = opener.document.alpha.beta.value }
strFile.WriteLine(txt);
strFile.Close();
}
</script>
again,
I am trying for a prompt box that asks the user what to name the file that is getting ready to be saved, which is the text in the textarea...to do this I would like to set a variable and place it in place of the "MyText.txt" string...
that way whatever name/ext the user types in the prompt box will be the name/ext the file is saved as... instead of how it is now defaulting to my pre-defined name/ext "MyText.txt"
thanks
co