简体   繁体   中英

Split Sonata User Bundle registration form into stages

I'm currently working on a user registration form for a site I'm working on. The site requires a lot of information about users up front, and I'd like to break it down into stages.

The first stage requires the user to put in an identifier in the form of an order number. I would then check the order number exists in the system before making them continue to fill in the rest of the fields. I'm not sure how to go about doing this.

What I've managed so far though is to override the underlying User , RegistrationController and RegistrationFormType and render out a customised view with the relevant form fields.

An overview of the process I'd like would be:

  1. FORM: ask for order number
  2. process form and check order number exists (if not go back to 1)
  3. FORM: ask for user information
  4. process user information and store
  5. complete

Simplest way of doing it will be to override registration template, and hide all fields except those you wanna show in first.

And than add some js validation rules, - to show up parts of form based on values prefilled by user. In that case you do not need to rework Sonata registration form, but for user experience it will be the same.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM