Date field select option in custom module I am using drupal 7 and i am need of create a custom module to show the selected filter option values to be displayed on some other pages. By default we using the filter in the views, it shows the filter result values on the same page. So that only i prefer to go custom module.

In my custom module i have four fields which are two drop down values and one keyword search functionality and final one is year based search. I have a problem with passing the drop down option year based filter. The functionality works fine for me. But while the we show the drop down of the year it doesn't mention the default select year. The first option shows empty and rest of the option shows the year. While picking a year it searches fine, But I want to show the default value in the year field, to know the field was choosing the year. 

I code is 

    function customsearch_box($form, &amp;$form_state, $form_id){
    $form['release_date']= array(
        '#type' =&gt; 'date_select',
        '#title' =&gt; t(''),
        '#title_display' =&gt; 'invisible',
        '#date_format' =&gt; 'Y',
        '#size' =&gt; 40,
        '#default_value' =&gt; 'RELEASE DATE',
        '#attributes' =&gt; array('title' =&gt; t('Enter the terms you wish to customsearch for.')),
      );
    }
    function customsearch_box_form_submit($form, &amp;$form_state) {
      if($form_state[input][release_date][year]=='RELEASE DATE'){
        $form_state[input][release_date][year]='';
      }
      $form_id = $form['form_id']['#value'];
      $form_state['redirect'] = array('research-result',
      array('query' =&gt; array(
        'field_srch_release_date_value[value][year]'=&gt;trim($form_state['input'][release_date][year]),),),);
    }
I can't find a link to any documentation for this at the moment, but the default value for a date field expects the date in a certain format: yyyy-mm-dd. It might sound counter-intuitive but something like this should work:

// Make up a date with the correct year
$time = mktime(0, 0, 0, 1, 1, $year);

// Format the date
$default_value = date('Y-m-d', $time);

// Set the default value
$form['release_date']['#default_value'] = $default_value;