How can I get a default value in a dropdown using form API? $results = db_select('users', 'u') -&gt;fields('u',array('name','uid','mail')) -&gt;execute();
$options = array();
foreach ($results as $result) {
$options[$result-&gt;uid] = $result-&gt;name.' | '.$result-&gt;mail;
}
unset($options[array_search(0, $options)]);
$form['user'] = array(
'#type' =&gt; 'select',
'#title' =&gt; t('Select User'),
'#options' =&gt; $options,
'#default_value'=&gt;('select a value'),
'#states' =&gt; array(
'visible' =&gt; array(
':input[name="data_set"]' =&gt; array('value' =&gt; 'education'),
 ),
 ),
);
$form['submit']=array(
'#type'=&gt;'submit',
'#value'=&gt;t('Expire')
);


I have this dropdown , how can I get the default value like Select a value or something
For required items a -select- item is added automatically. If the form field is not a required one, you'll have to add it manually, for example with the following code.

  $options = array('_none' =&gt; '-select item-') + $options; //Places an extra option at the start


If it's the first item it should be selected automatically but if you want to be safe. 

  // Use the array key, not the value.
  '#default_value' =&gt; '_none', 


You'll have to filter it out the '_none' value in the submit handler afterwards.