1

I'd like to add a 'Year of birth' field to the build-in registration form. Therefore, I created the Integer field 'Year of birth' at Administration > Configuration > People > Account settings.

I set the minimum value to 1900 and the maximum value to 2013. But, instead of '2013', I'd like to use the token [site-date-yyyy], so that I don't have to change the maximum value every year. Unfortunately, only integers are accepted. How can I use a token?

1 Answer 1

1

Try the Date module

  1. Install the module
  2. Go to Configuration > Account Settings > Manage Fields tab
  3. Add a date field of type "Date" and widget "Select list"
  4. Hit Save
  5. Deselect every date piece except year
  6. Hit Save field settings.
  7. Check Display on user registration form.
  8. Expand More settings and values
  9. Set starting year and ending year and default value.
  10. Save settings

If you must use a text field, the date field gives you that option as well. You wont be able to set a start or end date, but the module will validate the date is in the proper format.

1
  • That works absolutely perfect! Thank you for your quick answer @Scott Joudry!
    – Jeroen
    Sep 22, 2013 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.