Date popup - how to restrict typing into the textfield and return timestamp instead of formated date In D7 I'm using date popup form element:

$form['sidebar']['reg_date']['from'] = array(
    '#type' =&gt; 'date_popup',
    '#title' =&gt; t('From:'),
);


When user click the textfield a popup calendar will appear, but user also can type the date into the textfield. But he can write something invalid like '44444' and this value will be returned in form state values without any form error. It would be useful if this module had an option for restricting typing date by keyboard. Is there any option for this?

I also have one side question: Is there any option to return unix timestamp value instead of formatted date in form state values? In my case it returns date in format '29.5.2016'.
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'),
    );