3

I try to create a multi step registration form! I have 1 form name = user-register.php and i created a 2nd form= user-register-2.php

How to make the button navigate from the 1st to the 2nd step? and from step 2 only have the profile created?

Here the code have have form 1:

<?php
osc_add_hook('header','ctg_housing_nofollow_construct');
ctg_housing_add_body_class('login register');
osc_enqueue_script('jquery-validate');
osc_current_web_theme_path('header.php');
$userEnabled = osc_user_registration_enabled();
?>

<form name="register" action="<?php echo osc_base_url(true); ?>" method="post" >

<input type="hidden" name="page" value="register" />
<input type="hidden" name="action" value="register_post" />


<button type="submit" class="small radius">
  <?php _e("Next Step 2 / 2", 'ctg_housing');?>
</button>

This code is for step 2:

<?php
osc_add_hook('header','ctg_housing_nofollow_construct');
ctg_housing_add_body_class('login register');
osc_enqueue_script('jquery-validate');
osc_current_web_theme_path('header.php');
$userEnabled = osc_user_registration_enabled();
?>

<form name="register" action="<?php echo osc_base_url(true); ?>" method="post" >

<input type="hidden" name="page" value="register" />
<input type="hidden" name="action" value="register_post" />

<button type="submit" class="small radius">
  <?php _e("Create Account", 'ctg_housing');?>
</button>

Thanks

GraveyardQueen
  • 771
  • 1
  • 7
  • 17
Rhoda
  • 99
  • 9

1 Answers1

0

Make 2 different forms, one for getting the values and second for showing the captured values.

After filling the first form, check the data validation and submit the form and hold these values in session and show it on second form by hiding the first form and showing the second form with per-filled data from session.

On click of submit button of second form, call the function that creates the user and go back to the first form or any where you want to and destroy the last values from session.

Mayank Pandeyz
  • 25,704
  • 4
  • 40
  • 59