DOCUMENTATION

  • Developer
Search »

ft_api_init_form_page

This valuable little function performs a number of tedious tasks, which previously had to do manually with PHP. This function does the following:

  • Creates a temporary storage for your form data in sessions (so you can access the already-submitted form data as the user progresses through the form)
  • Requests a unique submission ID for the form submission (one submission ID per form submission - even if it's a multi page form)
  • Returns ALL form data submitted to date. So if you have a multi page form, on page 3 of 5, it'll return all the first 3 form submission field information. This can be handy if you need to re-fill form fields when the user returns to an earlier page.

This function accommodates the three stages of your form:

  1. Initial setup (before integration with Form Tools)
  2. Putting through the test submission
  3. Processing "live" submissions

Initial setup

Before trying to put through your test submission, you should get your form working with this function. Add this PHP code to top of the FIRST page in your form (even if it's a single page form):

Next, if you have additional pages, add the following to the top of all subsequent pages:

Note that they're very similar. The difference it that the first page sets up the environment: it lets the function know not to try to retrieve the submission ID (since the form doesn't exist yet!)