Add some more required fields to the user registration form

Hi,

I was wondering if somebody can answer my following question. I would like to add some more requiered fields in the user registration form (like the adress etc). It should be like the contact form where the user can fill in the street, city, country, phone etc). Is there a easy way to expand the registration form with this kind of fields?

Thanks for your help

Noppes

Comments

  • acrylian Administrator, Developer
    These fields are already on the user account tab, although not required.
  • Yes, they are. My thought was that a new user need to provide these information during the registration process and not as a option later after the registration.
  • acrylian Administrator, Developer
    Ok, then please open a ticket
  • Or just clone the plugin and add those things to it. Those fields are not necessarily present in an installation--they are provided by other plugins.
  • Thanks for your answers! I would like to add the missing fields to the form, but how do I know the field names? Can I add more fields like this:

    <td><?php echo gettext("City:"); ?></td>
    <td><input type="text" id="admin_city" name="admin_city" value="<?php echo html_encode($admin_n); ?>" size="22" /></td>

    Thanks for ypur help.
  • You will have to look at how the Comment Form handles these. There are no explicit fields for the address information. Instead the comment form plugin uses the custom data field for storing them.

    [edit]
    Well, this seemed a good feature. So in the development branch it is implemented. If you wish to try this, after tonight download the development nightly build.
  • Sbillard, thanks for your implementation! That is great!

    Today I had the chance to test it. It works fine. Would it be possible to set the adress fields as required? If I don't fill them out I don't get an error message.

    Thanks again

    Norbert
  • I thing that I notice in the development version is, that if you don't provide the right information in the email or password fields and an error message comes up, that you will lose your already filled in information in your adress fields. Your name, mail adress will be prefilled, but not the adress information. Is it possible to change that, too?

    Thanks

    Noppes
  • Sure, but that certainly will not prevent "bogus" input. That is why I did not make that option in the first place. I did not think it really added anything to the issue.

    [edit] Turns out it is easy to require the address. You just have to set the same option for the comment form--that is where the address handling comes from. If you do not want comments normally enabled, just temporarily enable the plugin, set the option, then disable the plugin.

    [edit again] Well that does not really work. Stay tuned. I will also preserve the posted data if there is an error.
Sign In or Register to comment.