'Saving as draft option'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aashishn86
    New Member
    • Mar 2009
    • 51

    'Saving as draft option'

    hii!!
    i am making a form in which the user fills in the fields and finally submits the form, which is then saved in the database

    i use asp
    and javascript for validations.

    the user can see, all the enteries as a list in another page.
    Now, i have to give the user a "save as draft" option.
    in which he can enter some fields and save the form and complete it later...


    maybe , i can have a "save as draft" button on the main form, on pressing which, the validations are not carried out, and the form is saved in some another table..

    and the list on which the user see's the added forms can have a "view drafts" link which opens up a list of "drafts"

    when the user clicks on it, the user can fill in the form , and click on submit it ( now the validations are carried on, and the form is saved in the original table )

    and the "draft" is deleted from the list after its "saved"

    that is the basic idea i have....

    I need help on how to go about it ?
  • GazMathias
    Recognized Expert New Member
    • Oct 2008
    • 228

    #2
    This is essentially no different than the way e-commerce websites store basket information, namely, using cookies.

    So, if the user has has ticked the save as draft box then you would write the form values to the cookie instead of the database.

    If the user has not ticked the save as draft button then you would check for the cookie and delete it if found, then write the form data to the database (or vice versa).

    Obviously when the form loads you would have the page check for the existence of the cookie to pre-fill the form (or display a button to fill it in using JavaScript, giving the user the choice).

    The obvious benefit of this approach is that you don't have to store lots of temporary data in your database.

    Downsides are that there is nothing to stop the user deleting cookies or disabling them altogether, and you also have to learn to deal with cookies through ASP, though the syntax of them is somewhat similar to other data structures in ASP as one one would expect. Try Googling ASP Cookies and you will no doubt come across a wealth of tutorials on the subject.

    Gaz.

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      you could also add a field to the db table, a boolean with a name like "isDraft". just a thought.

      Jared

      Comment

      Working...