Services

  • Drupal CMS Websites
  • Drupal and PHP Developer
  • Custom solutions in PHP/MySQL/jQuery

Welcome

Welcome, I am a Web Developer based in Estepona, Costa del Sol, 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 http://drupal.org/node/292667

Comments

Thanks! I have been looking

Thanks! I have been looking for this all over.

Post new comment

The content of this field is kept private and will not be shown publicly.
5 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.