Welcome Guest, Not a member yet? Register   Sign In
need suggestions. multi-step form
#1

[eluser]Corbee[/eluser]
Hi, guys,

I need your suggestions on how to create a multi-step registration form where one of the step includes something like "Add another one" which when clicked will duplicate that step.

This "Add another one" can be done multiple times.
#2

[eluser]mddd[/eluser]
Verify your form as you would normally. If it's okay, add the data to an array that you store in a php session.
Code:
$_SESSION['items'][] = $new_data;
When the user is finished you take all the data stored in $_SESSION and store it.
#3

[eluser]Corbee[/eluser]
But how do I avoid the back button and refresh problem?

Thanks again
#4

[eluser]mddd[/eluser]
Why would that be any more of a problem here than with any other form?
#5

[eluser]Corbee[/eluser]
I was afraid people may click back button in the "Add another one", which may cause the data not to be accurate
#6

[eluser]mddd[/eluser]
I understand, but I think that's a problem that is common to all forms. You can add a random code in each new 'add one' form. When it is successfully saved, use a new code. You keep the code along with the data. If you get a form with the same code as you already have, you know you shouldn't save it again.

Also, if you show the user a list of items they have entered. So they can see when they mess up.
#7

[eluser]Corbee[/eluser]
Thanks again, I'll try doing it.




Theme © iAndrew 2016 - Forum software by © MyBB