I'm sure this issue has been brought up before. I have done a lot of searching through this site for the answer but it seems the sollutions I found were for ver 4 and were not applicable to ver 5.

I need to add custom fields to the registration process (address, phone number etc.) and make some of them validate.

Can somebody please point me to the documentation that will help me do this?

Many, many thanks!

Comments

luyendao’s picture

I don't know if you mean this, but the profile.module comes with drupal 4.7+ i believe, or 4.6 even - and all you have to do is turn it on. How well the fields validate, i think it's pretty limited - you might want to look at, user profile as a node.

What you can try and i've been meaning to use this, because it's so much better than using the profiles module, is this module: http://drupal.org/project/nodeprofile - node profile, which lets build user profiles as nodes, more specifically you can use CCK which has validation built-in for email field, and i believe phone as well.

3cwebdev’s picture

Yes, it was the profile module that I was looking for and didn't notice there in the list. It appears that will do what I need for now. Thanks!

kscheirer’s picture

hook_user()

there's a lot of ops for that function, but these should be enough to get you started

function hook_user($op, &$edit, &$account, $category = NULL) {
  if ($op == 'register') { // present form elements to inject into the form
    ...
  } else if ($op == 'validate') { // validate custom additions to user object
    ...
  } else if ($op == 'insert') { // adding user account. save custom additions to user object and set saved fields to NULL in $edit
    ....
  }
}

hope that helps!