No announcement yet.

How to create a multi steps form application?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to create a multi steps form application?


    I want to create a form with several steps and probably with progress bar. I plan it to have the first page or first logical section to save the data in the first table then the second page or second logical section to save the data related to the data in the prior page to be saved in the second table.. and so on.. But the data should only be inserted upon submission at the last page.

    Please help. Thanks!

  • #2
    I think there are many ways to go about this and a couple of possibilities I see readily are:

    Option 1: Multiple SC Form Apps

    After completing form 1, it should use sc_redir to go to form 2. Might be the easiest.

    Option 2: Single SC Form/ Control App

    Create multiple blocs in the form/ control and hide all except 1st one on page load. After each section (block) successfully completed, hide the completed block and reload the page, using some session variable to know what part has been completed and thus what to save/ what to show/hide. With form app, you can save all in same table automatically and use a flag column set to "complete" when last block is saved (or copy the record from a dummy table to the real table). With control, you can sc_exec_sql to insert into the different tables and then copy into a final table at the end.

    For options 1 and 2, you show your updated progress bar graphic in the Layout->Header & Footer, header variable. For option 1 this can be static but option 2 will require a session variable name for the image which gets updated per section/ block you save.

    Option 3: Blank App embedding an SPA

    If you don't already have, there should be some single-page app code you can find off the web, style and place into a blank app to do this, calling other SC blank apps to insert into the appropriate tables by ajax.