#1
  1. No Profile Picture
    kumars
    Guest
    Devshed Newbie (0 - 499 posts)
    I have a an user registration database. Instead of having all the 60 fields in one form, I wanted to do it in 3 forms.

    Form1 - for user information
    Form2 - for company information
    Form3 - for userid password.

    The logic of the form should be that the user cannot fill Form3 without completing Form2 and Form1 etc after data validation(no space in last-name, zipcode, phone, email).When the user in Form3, and wish to change Form1 field it should be possible.

    Can some one give me what technicque (cookie or Global variables etcO) is appropriate for this..

    Advance thanks

  2. #2
  3. No Profile Picture
    rod k
    Guest
    Devshed Newbie (0 - 499 posts)
    3 makes it a bit tricky since you want to be able to allow editing. The best solution I can see is to create a table for temporary storage. When you process the first form and after validation store those entries in the table. Same for 2. Then with the third after validation you can pull all the info from the previous 2 forms and put it all in your perm table. The temp table should contain a unique id that can be passed to each form. If the id is set your script can pull the previously stored info from the temp table and include it in the form as HTML input "value"s.

    HTH

    Rod
  4. #3
  5. No Profile Picture
    moderator
    Guest
    Devshed Newbie (0 - 499 posts)
    You could also pass all the variables as hidden fields in the HTML code, then actually make the mysql query after the 3rd form. So if they don't complete all 3 forms nothing gets stored in any table. However, depending on the forms that can get tricky and pretty ugly.
  6. #4
  7. No Profile Picture
    rod k
    Guest
    Devshed Newbie (0 - 499 posts)
    This is true, but again, it would be very, very ugly since he wants to allow editing of the previous changes, so you'd have to pass all those variables back to the beginning. Really, bad would be if the user is at the third page and wants to change the first. You'd have to carry all the variables for page 2 and 3 to 1 then back. YUCK.

    Since he said he had a DB available I'd use that and let each form only worry about itself. Check a session id, check the table to see if it has info already stored and generate the form using the data from the table to auto-populate the form. Bingo! No muss, no fuss.

    If I didn't have a DB available I probably wouldn't even tackle this. If I HAD to do it, I'd at least use a flat file.

    Rod
  8. #5
  9. No Profile Picture
    Paul Cotton
    Guest
    Devshed Newbie (0 - 499 posts)
    You would use PHP to get all variables from the preceeding page using :
    while ( list( $key, $val )=each($HTTP_POST_VARS) )

    and auto create the hidden fields in the forms, minimising the work.

    This would work in reverse as you could look at the fields and repopulate the html form elements.

    No database, very quick and relatively easy.

Similar Threads

  1. Multiple choice, multiple page forms
    By Iswd1 in forum PHP Development
    Replies: 1
    Last Post: February 3rd, 2004, 05:43 PM
  2. winsock with multiple forms
    By collegegirly in forum Visual Basic Programming
    Replies: 2
    Last Post: January 13th, 2004, 04:05 PM
  3. Multiple forms (file upload+textarea): one is erased
    By Reks in forum PHP Development
    Replies: 2
    Last Post: December 29th, 2003, 12:12 PM
  4. how to combine multiple variables into string
    By uab in forum C Programming
    Replies: 3
    Last Post: December 8th, 2003, 02:57 PM
  5. jsp using multiple forms
    By stoutr5 in forum Java Help
    Replies: 2
    Last Post: October 2nd, 2003, 09:32 PM

IMN logo majestic logo threadwatch logo seochat tools logo