disable date field (only update with datepicker) I am using drupal 6, im my form I put the date field as   

$form['myform']['from_date'] = array(
    '#type' =&gt; 'textfield',     
    '#title' =&gt; t('From date'),       
    '#size' =&gt; 8,
    '#default_value' =&gt; (arg(5) == null)? '0':arg(5),  
    '#attributes' =&gt; array('onclick' =&gt; 'GetdatePicker(this);'),
);


i want that user can not edit this field without using date popup(populated from date picker).
any suggestion.
Add 'readonly' => 'readonly' attribute to your field, 

ie: 

$form['myform']['from_date'] = array(
'#type' =&gt; 'textfield',     
'#title' =&gt; t('From date'),       
'#size' =&gt; 8,
'#default_value' =&gt; (arg(5) == null)? '0':arg(5),  
'#attributes' =&gt; array('onclick' =&gt; 'GetdatePicker(this);', 'readonly' =&gt; 'readonly'),
);