Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Need to Save Hidden form variable values to desktop file in ASCII Format


Message #1 by "Prabhakar Kompella" <prabhakar.kompella@r...> on Wed, 23 Jan 2002 16:47:26
Hi.

I need to save the value of hidden form value (Text field) to a local 
desktop file in ASCII Format. Can anyone help me with the javascript 
needed to do the same and which works both in IE & Netscape 4.0 or greater.

I am using the following but its not working in Netscape.Also the value is 
being stored in unicode , while I need it to be in ASCII.

<SCRIPT>
function SaveVarAsFile(){
  var varField1 = this.Field1.value
  document.open("text/plain","replace")
  document.write(varField1)
  document.close()
  document.execCommand('SaveAs',false,'.txt')
}
</SCRIPT>

Thanks
Prabhu

  Return to Index