douwen7603 2017-01-11 04:47
浏览 142

如何在Osclass中创建多步骤用户注册

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

  • 写回答

1条回答 默认 最新

  • douliao7354 2017-01-11 04:58
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看