writing out to a text file with javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ron Smith

    writing out to a text file with javascript

    What I want to do is create a HTML form that allows the user to enter data
    into about 10 fields, and then based on the entered data, writes out data
    strings to a text file. I am attempting to create a form for entering
    simple rectangle CAD data via a HTML form, which will be written to a text
    file, and then imported into a CAD program.

    The form would contain prompt boxes for things like length, width, radius
    size, step/repeat, etc. When the user hits the "SUBMIT" button, the data
    strings would be written out to the filename the user specified. Below is
    an example of data strings to be ouputted. Variables are &L, &W, &R,
    &STEPX, &STEPY, &XN, &YN.

    FRO 0 0 BY &L 0 ATT 1 POI 2
    BY 0 &W ATT 1 POI 2
    BY -&L,0 ATT 1 POI 2
    TO 0 0 POI 2
    JOI EXT 1 2 BLE &R
    JOI EXT 2 3 BLE &R
    JOI EXT 3 4 BLE &R
    JOI EXT 4 1 BLE &R
    TRY;SEC LAYOUT;REC;LAYO UT;YRT
    SUB A POS 0 0 ATT 0;FILE A INT
    MER A TO A
    TRY;COP 1 BY &STEPX 0 TIM &XN-1;REC;YRT
    TRY;COP .. BY 0 &STEPY TIM &YN-1;REC;YRT
    --------------------------------------------------------

    Any help on a source of example code would be appreciated.



  • Richard Cornford

    #2
    Re: writing out to a text file with javascript

    Ron Smith wrote:[color=blue]
    > What I want to do is create a HTML form that allows the
    > user to enter data into about 10 fields, and then
    > based on the entered data, writes out data strings to a
    > text file. I am attempting to create a form for entering
    > simple rectangle CAD data via a HTML form, which will be
    > written to a text file, and then imported into a CAD program.[/color]
    <snip>[color=blue]
    > Any help on a source of example code would be appreciated.[/color]

    The answer depends on context information missing from your post. In a
    web page loaded from a remote server over HTTP normal security
    provisions prevent any client-side script form accessing the client's
    local file system. Other contexts introduce possibilities, for example,
    a WSH running locally on a Windows box could employ Internet explorer to
    provide an interface form defined as HTML and manipulate entered data,
    saving it to the local file system.

    Richard.


    Comment

    • Ron Smith

      #3
      Re: writing out to a text file with javascript


      "Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message
      news:cf2pqg$7ha $1$8302bc10@new s.demon.co.uk.. .[color=blue]
      > Ron Smith wrote:[color=green]
      > > What I want to do is create a HTML form that allows the
      > > user to enter data into about 10 fields, and then
      > > based on the entered data, writes out data strings to a
      > > text file. I am attempting to create a form for entering
      > > simple rectangle CAD data via a HTML form, which will be
      > > written to a text file, and then imported into a CAD program.[/color]
      > <snip>[color=green]
      > > Any help on a source of example code would be appreciated.[/color]
      >
      > The answer depends on context information missing from your post. In a
      > web page loaded from a remote server over HTTP normal security
      > provisions prevent any client-side script form accessing the client's
      > local file system. Other contexts introduce possibilities, for example,
      > a WSH running locally on a Windows box could employ Internet explorer to
      > provide an interface form defined as HTML and manipulate entered data,
      > saving it to the local file system.
      >
      > Richard.
      >
      >[/color]
      In the beginning, it would be soley running on an intranet within our
      company. I am not sure if this is what you are referring to. I am also
      unaware of what WSH is, but will do a search for it.


      Comment

      • MikeB

        #4
        Re: writing out to a text file with javascript


        "Ron Smith" <rsmith@qwest.n et> wrote in message
        news:2nkaqmF1q8 6pU1@uni-berlin.de...[color=blue]
        >
        > "Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message
        > news:cf2pqg$7ha $1$8302bc10@new s.demon.co.uk.. .[color=green]
        > > Ron Smith wrote:[color=darkred]
        > > > What I want to do is create a HTML form that allows the
        > > > user to enter data into about 10 fields, and then
        > > > based on the entered data, writes out data strings to a
        > > > text file. I am attempting to create a form for entering
        > > > simple rectangle CAD data via a HTML form, which will be
        > > > written to a text file, and then imported into a CAD program.[/color]
        > > <snip>[color=darkred]
        > > > Any help on a source of example code would be appreciated.[/color]
        > >
        > > The answer depends on context information missing from your post. In a
        > > web page loaded from a remote server over HTTP normal security
        > > provisions prevent any client-side script form accessing the client's
        > > local file system. Other contexts introduce possibilities, for example,
        > > a WSH running locally on a Windows box could employ Internet explorer to
        > > provide an interface form defined as HTML and manipulate entered data,
        > > saving it to the local file system.
        > >
        > > Richard.
        > >
        > >[/color]
        > In the beginning, it would be soley running on an intranet within our
        > company. I am not sure if this is what you are referring to. I am also
        > unaware of what WSH is, but will do a search for it.[/color]

        Well if it's an intranet, then you can use HTA which is absent Explorers
        security considerations.

        Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

        [color=blue]
        >[/color]


        Comment

        Working...