• Drupal CMS Developer
  • Website speed optimisation
  • Drupal 6 to Drupal 8 migrations


Welcome, I am a Web Developer based in Madrid, Spain originally from the UK. I studied Computer Science & eBusiness at Loughborough University. I specialise in Content Management System websites

Using date popup fields from the date module

I found it hard to find information on how to implement a date field in your forms using the form API. I actually wanted a date popup field. Below is the code for using it

$form['dob'] = array(
  '#type' => 'date_popup',
  '#title' => t('DOB'),
  '#date_format' => 'Y-m-d',
  '#date_year_range' => '-100:+0',

You can also find more options here


Thanks! I have been looking

Thanks! I have been looking for this all over.

Me, too!

Me, too! Thanks for this!