Multiple Stage Form

kuproverto's picture

I have a form that collects a lot of information, too much for one page so I want to space it out over several stages.

How do I retain the information through these stages so it can all be submitted to the db at the final stage?

I'm guessing the answer has something to do with session variables which I've never used.

SKaze's picture

Just use a cookie.

kuproverto's picture

Thanks. I've never used cookies either so I guess I'll have to learn!

ddeems's picture

Btw, if you have a choice, cookies are better than session variables for most things, because you can always recall the user's choices / responses if he navigates away and comes back after the session times out, such as a shopping cart or checkout where a person might be likely to leave and then return later in the day or the next day.

However, you probably don't want to store credit card, social security numbers, or other extremely personal information in cookie form just to avoid freaking out the consumer if they do come back. In those cases, a session variable is more useful.

kuproverto's picture

Thanks.

I'll be collecting contact, and financial information so maybe I should use session variables after all.

Jeremy Palmer's picture

If you're collecting sensitive financial information I would recommend against storing it in cookies. Instead - use hidden form variables - .

If you're working with sensitive information it's also advisable to use a secure connection - https://

Best,

Jeremy

kuproverto's picture

Thanks.

The form will be divided into 4 stages so it will have to be submitted 3 times during completion and, obviously, once once it is completed.

Could you give me an example of the code I need to write to achieve this?

I'm a little confused how to store the form field data in hidden fields from page to page.

Jeremy Palmer's picture

Let Google be your guide ;)

Query: "multi page form with php"

http://www.google.com/search?hl=en&q=multi+page+form+with+php&btnG=Google+Search

Top Result: "Working with Multi-page Forms in PHP" - from the creators of PHP (Zend Labs)

http://www.zend.com/zend/spotlight/code-gallery-wade7.php

Best,

Jeremy

kuproverto's picture

It seems I posted the wrong question...Doh!

I wrote the question I posted. Then I thought, as Google is my friend, I'd find the answer there. During my research I wondered if there was a DW CS3 extension which could do this. Again, Google provided many results but the only extensions I could find were for MX.

The question I should have posted is:

Do you know of any DW CS3 extensions for creating multi part/page forms?

pflyers's picture

I don't think your going to find one. You have to use hidden form fields to hold the data and pass it on.

It's honestly not that hard.

kuproverto's picture

OK, thanks.

Syndicate content