Change the title of date_popup filed in custom form I'm building a custom form in Drupal 7 and i need to use the date_popup widget in it. It all works as expected, except the title of the field.

My code is:

  $form['filter']['start_date'] = array(
    '#type' =&gt; 'date_popup',
    '#date_format' =&gt; 'd-m-Y',
    '#title' =&gt; t('Start date'),
  );

  $form['filter']['end_date'] = array(
    '#type' =&gt; 'date_popup',
    '#date_format' =&gt; 'd-m-Y',
    '#title' =&gt; t('End date'),
  );


But it keeps showing the default label "Date" for the field, as you can see on in the picture below. 

Can you please let me know how can i put Start date and End date as field labels instead of just Date, or correct me if i'm doing something wrong
Just use the following code:

'#date_label_position' =&gt; 'none',


your code :

$form['filter']['start_date'] = array(
    '#type' =&gt; 'date_popup',
    '#date_format' =&gt; 'd-m-Y',
    '#title' =&gt; t('Start date'),
    '#date_label_position' =&gt; 'none',
  );

  $form['filter']['end_date'] = array(
    '#type' =&gt; 'date_popup',
    '#date_format' =&gt; 'd-m-Y',
    '#title' =&gt; t('End date'),
    '#date_label_position' =&gt; 'none',
  );