Date popup - how to restrict typing into the textfield and return timestamp instead of formated date
You can use ['#attributes'] = array('readonly' =&gt; 'readonly');

Ex: 

    $date_format = 'd/m/Y H:i';
    $form['campaign_popup'] = array(
          '#type' =&gt; 'date_popup',
          '#date_format' =&gt; $date_format,
          '#default_value' =&gt; variable_get('campaign_popup'),
          '#title' =&gt; t(' Campaign Start Date.'),
          '#date_label_position' =&gt; 'within',
          '#date_year_range' =&gt; '0:+3',
          '#datepicker_options' =&gt; array('minDate' =&gt; 0),
          '#attributes' =&gt; array('readonly' =&gt; 'readonly'),
    );