Hi,
You might also try the saveAs dialog box and an iframe:
Code:
<script type="text/javascript">
<!--
function saveIt(formObj)
{
var txt = '';
for (i = 0; i < formObj.length; i++)
{
txt += formObj.elements[i].name + ' = ' + formObj.elements[i].value + "<br>";
}
theFrame.document.open("text/html","replace")
theFrame.document.write(txt)
theFrame.document.close()
theFrame.focus()
theFrame.document.execCommand('SaveAs',true,'myfile.txt')
}
//-->
</script>
</head>
<body>
<iframe id="theFrame" style="display:none"></iframe>
<form>
<input type='text' name="a">
<textarea name="b"></textarea>
<input type='button' value='save it' onclick='saveIt(this.form)'>
</form>
You do realize, though, this only works with windows/ie?
Vinny
Bookmarks