0

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
diggersworld
  • 12,770
  • 24
  • 84
  • 119

1 Answers1

0

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.

pomaxa
  • 1,740
  • 16
  • 26
  • I'd rather have it run through PHP than JS. The first two fields I show will need to be checked against the database to make sure that the Order exists. This will then return an identifier which can be used in the next phase of entering the user's details. – diggersworld Sep 08 '15 at 09:07
  • @diggersworld - you can always do it via ajax; – pomaxa Sep 08 '15 at 09:27