Trouble breaking user_register form into multiple steps

tseven - April 27, 2009 - 22:39

I am developing a COPPA age verification module which will first ask the user registering their age.

This age form should be displayed first, the next form will be built based on the answer.

I am a seasoned PHP developer but new to the drupal API.

I've read several articles on altering existing forms and even on making a multi-step form.

What I'm having trouble with is "stopping" the default register form from displaying.

My first instinct is to save the default form data created by drupal and the profile module, creating my age form, then later appending the original form data.

This doesn't seem to be the proper or most efficient method.

I'd greatly appreciate some pointers on how execute this the "proper" way.

I'm not looking for complete code doing the work for me, but simply the ideal process and functions/hooks to use.

My end goal is this:
User registration:
The first screen simply asks the user their age. After clicking "next/submit" they are presented with the full registration form asking for their username/email etc.

Please let me know if my goal isn't clear.

Thanks in advance!
Steven

Have you considered possibly

Keyz - April 28, 2009 - 01:05

Have you considered possibly helping with upgrading this module to Drupal 6 instead? http://drupal.org/project/coppa
If the module is not actively maintained or the maintainer needs help, you can submit a request to become co-maintainer (or in the case of an abandoned module, you can take it over, and change it in any way necessary - of course best to keep in mind the needs of the module's current users, in addition to your own changes). It looks like there is a dev version of Coppa module that is Drupal 6 compatible so you might be able to help them finish it up and put a release out.

In any case, I'd encourage you to "consider" this option... as duplicated modules in Drupal is a major problem that makes it harder for end users to decide on which to use. Always better to contribute to an already existing solution if at all possible.

Probably not needed in this case, but in case you're not yet aware of it... have a look at the Coder module, which makes it pretty easy to upgrade a module by analyzing the code for you, finding areas that need to be upgraded, and pointing you to the exact piece of documentation required to preform the change.

I didn't consider that

tseven - April 28, 2009 - 23:10

I didn't consider that because I didn't dig deep enough to discover a D6 development version. I'm learning D6's API but don't know anything about 5's, so porting it wasn't an option at this point.

I will take your advice and see what I can do.

Also, thanks for the coder module, I'm sure that will come in handy.

Thanks again.

After reviewing this module,

tseven - April 29, 2009 - 00:03

After reviewing this module, it is not what I need.

The COPPA module is a restriction applied after the user has signed up.

I must validate the user's age before signing up.

 
 

Drupal is a registered trademark of Dries Buytaert.