1. Welcome to Game Makers Forums

    Whether you are a new, amateur or professional developer, you will find your place here.

    Register to Download Sample Code or Advertise your Project.

    Register also gives you the ability to be helped or help others:

    Dismiss Notice

Multi page form

Discussion in 'Web' started by xGx, Jan 4, 2017.

  1. xGx

    xGx Administrator

    Joined:
    Oct 8, 2014
    Messages:
    301
    Likes Received:
    94
    Trophy Points:
    28
    Gender:
    Male
    I need your help. I am currently working on a registration form and descided that it is too large too fill in with 1 go.

    Any of you have experience with this? I have done it once years ago since I dont really like it.
    Now I am going to force validtion on each page before you can go to an other.

    What I am stuck with is. do a partial save in a temp table or so and on complete create the user. or just one post at the end.

    btw the registration is similar to those on dating sites.
     
  2. sniko

    sniko Active Member

    Joined:
    Oct 9, 2014
    Messages:
    188
    Likes Received:
    80
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Programmer
    Location:
    South England
    Home Page:
    Why not store the user inputs into their session. It's on the server, and garbage collection is handled with your language of choice, and easy to access (read/write) with the languages session API.

    Apart from that, you could do a JavaScript multi-step form to split the views out to the end user and one POST to your server?
     
  3. xGx

    xGx Administrator

    Joined:
    Oct 8, 2014
    Messages:
    301
    Likes Received:
    94
    Trophy Points:
    28
    Gender:
    Male
    snikosniko thanks for your reply.

    I was thinking about the session. The only problem I have with it, I like to have each page issolated.
    If I open a new form it should have its own data contained and not from the session.

    I am splitting it like you suggested with js. I tend to overthink stuff sorry. but lets say client validation goes well.
    it says the email and some date are valid(different pages) on post the server says "Hold it" these values are wrong.
    it can be a hassle. in my case I have 3 pages. wont ever get to more. but lets say you have an error on page 1 and 5 and have a total of 10 pages
    thats alot of clicking to get to the last page. unless you make some shortcut.

    but that said its not relevant to my scenario and wont ever be so should skip it.

    What I was originally thinking was on the first page do a submit create the user in a temp table (db or memory). returns an token.
    which the other pages also use lets say its an issolated per page session. and daily have a script run that gives me some stats on what
    page most ppl stop if they dont complete the form, so it can be fixed or optimized. what do u think?
     
    • Like Like x 1
  4. xGx

    xGx Administrator

    Joined:
    Oct 8, 2014
    Messages:
    301
    Likes Received:
    94
    Trophy Points:
    28
    Gender:
    Male
    maybe I should explain what I am making exactly. its a registration page where ppl enter login credentials and personal credentials like age, city etc,

    then they fill their match profile (min age, max age, state of match partner)
    and after what they wish to dance (dance style, interest level, skill level)

    its my old project that I am revamping
     
  5. Colum Ferry

    Colum Ferry Moderator

    Joined:
    Jan 8, 2015
    Messages:
    660
    Likes Received:
    219
    Trophy Points:
    43
    Gender:
    Male
    I would use session, or maybe, possibly, javascript.
    Use javascript to isolate the pages (but have it all on one page, use divs and just hide and show as needed), send the data to a server side validator when the user clicks next page (or even, once they complete the last form element on the current page), see what values the server thinks is wrong, if some are, use the callback to show the user a dialog box to say there is a problem with something they entered, but whilst waiting on the server, the user can fill out the next page of details.

    Another thing you could maybe use is Accordions. Have a section of the form in each, and use javascript to collapse one and expand the other once one form part is finished.
    Then use AJAX to send the data off, if validator on server complains, open the correct accordion and focus on the input element causing the issue.
     
  6. G7470

    G7470 Active Member

    Joined:
    Oct 7, 2014
    Messages:
    314
    Likes Received:
    137
    Trophy Points:
    43
    Gender:
    Male
    Occupation:
    Web Applications Developer
    Home Page:
    If you're writing this in .NET, you can use a Wizard Control to accomplish this. This will separate your form out into the "steps" that you want, and you can validate your controls as you need to, including changing what's available in future steps based on user input in previous steps.

    ~G7470
     
    • Like Like x 1
  7. a_bertrand

    a_bertrand Administrator

    Joined:
    Oct 28, 2014
    Messages:
    1,276
    Likes Received:
    565
    Trophy Points:
    113
    Gender:
    Male
    Honestly I usually don't like much multi-pages forms while I do see why it could be useful. So if you do one, please allow to go back to a previous step ;)

    I would also use JS (with some AJAX) validation, and a submit at the end. The only issue I would make sure is that when the user start the registration then the username is created directly and not have the risk to loose this username during the registration time.
     
    • Like Like x 1
  8. xGx

    xGx Administrator

    Joined:
    Oct 8, 2014
    Messages:
    301
    Likes Received:
    94
    Trophy Points:
    28
    Gender:
    Male
    a_bertranda_bertrand most do that indeed. they create the user in the first step. then u can continue or on next login.

    now I have it like this I have one big table with Complex types after first post it creates the initial table with the data.
    ten returns a guid to where you are redirected. as a isolated session then the next steps and while that table has not expired(20 min)
    then the nickname is secure and on the final step its stores it into the proper table.

    there is a back button and each form is validated and created or updated with ajax on "next"
     
    • Like Like x 1
  9. spudinski

    spudinski Active Member

    Joined:
    Dec 21, 2014
    Messages:
    335
    Likes Received:
    128
    Trophy Points:
    43
    Gender:
    Male
    Please don't make innocent people fill in a 5 page form to register on a website.
    Let them register with basic info and complete other things as and when required.
     
    • Agree Agree x 1
  10. xGx

    xGx Administrator

    Joined:
    Oct 8, 2014
    Messages:
    301
    Likes Received:
    94
    Trophy Points:
    28
    Gender:
    Male
    spudinskispudinski after the first page they will get an email
    you are right. but they are 3 really short pages. but the last page you can add interest. and can get long.
    its just a way to keep it readable for the user atm. will add a option to force or not to force to fill all 3 pages
    before you can do anything. such sites have lots of lurkers. But to be honest I hate sites where I have to log
    in to even view profiles
     

Share This Page