For user registration that has profile2 fields on the form that have multipage, I can't seem to get the module to work. I've enabled it but it doesn't seem to be doing validation when I change pages etc.

Comments

Juryiel’s picture

Looks like this is because user registration forms have sub arrays thta contain the #groups, rather than the groups being directly under $form. How can I specify an arbitrary array name such that I can convert:

$form['#groups'] from the module to $form['arbitrary_profile_type_name']['#groups']? I would like it to work for all profile types, and i have a few, so directly putting the profile type name is not ideal.

sinasalek’s picture

It's a nested form that are not supported yet,
I guess that that the pages are not ajaxified (you should not see any loading when moving between pages), is that so?

Juryiel’s picture

Correct. I was able to ajaxify the form by adding ['profile_my_profile'] before ['#groups'] but obviously this breaks non-nested forms, and there are still issues with the formatting (the pages are all displayed at once). Hopefully support for these types of forms will be added, if not I can probably hodgepodge it together for my purposes but I doubt I can put something together good enough for a general patch.

Juryiel’s picture

Not sure if you're working on this but after a bit of work I've been able to get stuff working (by putting [profile_my_profile] in the right places) with the method I specified above. Everything works right, with the Next and Previous buttons fully ajaxified and the submit button saving the information on all pages. The only problem is that I can't get the submit button ('Save') when editing a user profile or the Create New Account button when submitting a registration form to ajaxify and check subsequent pages that have not been filled in. For example, if you fill in the first page, and the second page has required fields, if the user hits submit the form will save with those fields being left blank. Any help with that would be appreciated.

Also, my plan was just to have a separate module for each profile type since I'm not good enough wiht this stuff to figure out a general solution. Do you know if this will cause conflicts if I have duplicate modules that just differ in [profile_my_profile] next to $form? Thanks.

NenadP’s picture

Subscribed to this, I am trying to use it with profile2 too!

Juryiel’s picture

I got most of it working, I just can't get the Save button to disappear when you click 'Previous'. It only shows up on the last page initially but going back pages doesn't make it disappear. If I cat it working I'll post the workaround solution until the author writes the proper code.

NenadP’s picture

My "workaround" is to use this approach http://drupal.org/node/1340082, it works well when you st up your custom module as described in discussion. Also it seems that I can benefit from clientside validation module in other forms.

dude74’s picture

I tryied to apply same method as Juryiel.
Adding [profile_my_profile] before each ['#groups'] displays all forms on one page only.

Modifying unset($form[$child_name]) to unset($form[profile_my_profile][$child_name]) recovers multipage display.

My problem is that clicking on "next" generates an Ajax Error (HTTP : 200).

Edited : find the source of the problem : conflict with Clientside Validation.
After disabling Clientside Validation, when I press "next", it now clears the current page (first step) and displays errors.

Edited2 : disable NO JS fix my blank profile fields. Password reset to blanck on each page...

Could you be more precise on the "right places" of the [profile_my_profile]
Thks

sinasalek’s picture

Even if everything else works there this core issue
Currently admin user create account form admin/people/create is not supported due to a bug in core #208790: Changing "Create new account" button text breaks admin/user/user/create form

zmove’s picture

+1 here. Need multistep for user account registration.

Vasiliy Grotov’s picture

Issue summary: View changes

Just a quick not for anyone working on this: $form_state['profiles'] here you can find all profile types those present in the form.

firewaller’s picture

+1

noopal’s picture

I don't know if this is related.

I am using profile 2 and have account settings set to 'users will be logged in immediately upon registering, and may select their own passwords during registration'.

The ajax field groups work but for some reason the account behaviour is changed so users have to verify their email before they can log in.

The setting remains the same but after completing the form, rather than being logged in they are shown a message saying they need to verify their email before they are logged in.

If I disable this module, the account setting works as expected.