Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to submit several pages from a form at once

    I would like to have a Form that will consist of several pages - at least 2-4pages. Is there any way for only the last page to have the submit button? In otherwords, the visitor will not submit all the pages until they complete the last page, then that will send all of the pages at the same time. Can this be done with just straight HTML? ?or what is the solution?


    Thanks,

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Basically you'd need to use a server side language - best would be PHP probably.

    For example, let's say it's a 2 page form. You'd need the second form to hold the values from the first form, by using hidden fields.

    eg. The first page contains the field for a username, they click a submit button, and the value is passed to the hidden field on the 2nd page (using Post).

    <input type='hidden' name='username' value='<?php echo $_POST['username'];?>'>

    For say a 5 page form, you'd need to build up the hidden fields on each page progression, passing all of the values to the next until you get to the final page.

    Hope that helps.

  • #3
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, for your help. This sounds to easy to be true. I'm not sure if I get the simplicity of it. Do I just add that script to each page to get the progressions?

    Thankx

  • #4
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not good with PHP so I'm sure someone can advise better, but the first page should submit to the second page, the second page should submit to the third page etc.

    The second page takes the values from the first page and puts them into the hidden fields, then when the second page is submitted to the third, the third page takes the values from the second page and the hidden values from the first page.

  • #5
    New Coder
    Join Date
    Aug 2003
    Posts
    87
    Thanks
    0
    Thanked 1 Time in 1 Post
    Well, if you will take many variables and pass them through several pages, you might want to use the PHP Sessions. But, you have to really make sure you understand what you are doing and there's a learning curve... It is not just 'cut and paste'.
    Try it.
    Neno


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •