We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23510
    • 168 Posts
    Hi

    Im building a form that has two submit buttons - one is to allow the user to save their data and to come back to it later (as it is a long form) and the second submit button is for saving the form contents to db and emailing the admin (which I can do with hooks).

    Has anyone tried something like this?

    Thanks
    J.
    • Yes; your submit buttons will have different name attributes and different value attributes. Your processing code simply checks for either of these in the POST and behaves accordingly. I would presume that the first option would save the user’s input and set a cookie. You might also want to have a passphrase requirement when this option is selected so that anyone else going to the form page on the same computer won’t get the original user’s data exposed.

      This would be interesting as well http://diveintohtml5.org/storage.html
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 23510
        • 168 Posts
        Thanks Susan. The only drawback with html5 storage is that it works on a per browser basis and a user who saves their data with one browser will not be able to retrieve it with another one.

        I have decided to use just one submit button, and to use a checkbox before the submit button that says "I have completed the form and ready to submit my information".