Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

question about forms...

Options
  • 01-04-2009 12:25pm
    #1
    Registered Users Posts: 10,339 ✭✭✭✭


    I have an idea for a form that I would like to run past the boardsies.

    its an online form that can also be downloaded and used offline. as such I'd like to have everything running in the page itself or on the client machine through javascript.

    so, brandishing my complete lack of javascript knowledge and barely passable html/form abilities I created a form that runs using javascript that users will eventually be able to load and run form their own desktop. (yay me!)

    now the problems:

    1. I'd like the form to spit out a formatted text document with the form content in proper places once the user hits submit. I know this can be done using server side scripts and submitting the text file back to the browser for the user to accep or cancel but how would this work offline ?

    2. alternatively, I'd like the form to open a new page / tab with the text displayed in a flat html document that can be copy/pasted into notepad

    3. is there any way to allow the user to import a formatted text file to the form and have it populate the fields ? this would allow the user to save their work as they go in the case of long forms ?

    should I just abandon the javascript/html idea and go learn how to write a proper application instead ?


Comments

  • Closed Accounts Posts: 12,382 ✭✭✭✭AARRRGH


    You could probably do all this fairly easy in VB.

    The offline website seems a bit weird tbh...


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    LoLth wrote:
    1. I'd like the form to spit out a formatted text document with the form content in proper places once the user hits submit. I know this can be done using server side scripts and submitting the text file back to the browser for the user to accep or cancel but how would this work offline ?

    This should be easy enough. Is the resulting form layout different to the input form? I'd say you could just use some DHTML to change the input boxes into <div> tags. However, I am not sure if the browser would print the newly rendered output, or the original HTML.
    LoLth wrote:
    3. is there any way to allow the user to import a formatted text file to the form and have it populate the fields ? this would allow the user to save their work as they go in the case of long forms ?

    I think you will run into security issues with this - I'd be concerned if JavaScript could access text files on my PC that easily.


  • Registered Users Posts: 10,339 ✭✭✭✭LoLth


    thanks for the replies.

    the output file would have sections that would be filled by the content from the form input areas. It would also have sections that, even if the form input is blank, would have content.

    I wouldnt want to access a text file on the local PC automatically, the user would have to upload it. if the javascripts and the html were downloaded to the local PC I wouldnt see a security issue. If its on the server, I dont want anything frm a local PC being stored longer than it takes to spit it back out again and I also dont want anything on the site to be able to write to a file on the PC without the users express consent (and interaction).

    AAAARGH: you reckon I should abandon the html side of things completely ?


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Then you could just have two sections:

    1) Input form
    2) Output form

    The input form is shown by default and the output one is hidden. The user enters their details, and presses the button. The JavaScript then takes the inputted values, puts them into <div> tags on the output form and then hides the input form and shows the output form.


  • Registered Users Posts: 10,339 ✭✭✭✭LoLth


    /slapsforehead

    you know, I even read an article about hiding and showing divs (was going to use that to make the form multi page) and i never even though of your input/output usage.

    will give it a go. :)

    thanks


  • Advertisement
  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Like I said, the only concern I would have is whether the browser will print the rendered output or the original output. If it's a problem, then you could just pop up a new window and write the output to it.


Advertisement