how to empty the first select option with form api? I have made two select fields with the form api d7 

and i need to make it required and the first option is null to force the user select both 

i tried with #REQUIRED #EMPTY_VALUE OPTION  but gives error unsupported operands

i see the validation function may help but my case have an ajax request based on the first select to get the values of the second 

so i need to make it required and the first is null

the code answer

 $form['gov']=array('#title'=&gt;'Gov','#name'=&gt;'governorate'
,'#type'=&gt;'select','#options'=&gt;$options,'#ajax'=&gt;array('callback'=&gt;'ajax_callback',
'event'=&gt;'change','wrapper'=&gt;'replace'
  ,'method'=&gt;'replace'));

 $form['city']=array("#title"=&gt;'City',
'#name'=&gt;'city','#type'=&gt;'select'
,'#prefix' =&gt; '&lt;div id="replace"&gt;',
'#suffix' =&gt; '&lt;/div&gt;','#options'=&gt;$op);


also the ajax request only happens one time
Add a empty value setting to the form array:

$form[$key] = array(
  ..
  '#empty_value' =&gt; '',
  ..
);


That will add a - Select - option to the list that will not pass a required validation if the user leaves it on - Select -.

Don't add an empty value to the #options array '' =&gt; t('Please select'). That will still pass a required validation if the user leaves that option selected.