Can you do this with JS?

Say you have a HTML Forms page and you want to take the data that is entered on that page and save it to the users hard drive, but in a comma delimited text file. Can JS be used for this?? If so, could someone provide some examples please??

Thanks
David

Comments

  • : Say you have a HTML Forms page and you want to take the data that is entered on that page and save it to the users hard drive, but in a comma delimited text file. Can JS be used for this?? If so, could someone provide some examples please??
    :
    : Thanks
    : David
    :
    No, that would be considered a major security hole. In addition, any HTML page could write a virus to any-one's harddisk.
  • [b][red]This message was edited by Josh Code at 2004-5-1 9:17:44[/red][/b][hr]
    : Say you have a HTML Forms page and you want to take the data that is entered on that page and save it to the users hard drive, but in a comma delimited text file. Can JS be used for this?? If so, could someone provide some examples please??
    :
    : Thanks
    : David
    :

    You can write files to a person's harddrive. To deal with security problems, the viewer of the page will always be asked for permission to make the file, however.

    JScript(something made by Microsoft) has a File object that you can use.

    There are ActiveX objects to use. Click the link below for a reading example.
    http://www.theserverside.com/discussions/thread.tss?thread_id=18599
    This object can also be used for writing files.

    take a look at this too.
    http://www.webreference.com/js/tips/001031.html

    I tried it out with Netscape and Internet Explorer and it only worked for Internet Explorer.

    Here is the code I used:
    [code]







    [/code]
  • ActiveX is IE-only (I'm not sure if IE Mac works, but who uses that when there's Safari?), and I'm pretty sure you need a plugin, although it's one that comes by default.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories