Form value not submitting for a function called from ajax I have created a form for creating some beaches. In that I have to give the value of continents,country ,name of beaches. Names of the countries and continent are stored in the taxonomy table. so if the user selects the continets, by using ajax it displays the list of countries belonging to the continent. my code look like..

function iks_beaches_create($node, &amp;$form_state) {


drupal_set_breadcrumb(array(
    l('beaches', 'beaches'),
    'Add New Beaches'
));   
    $form['iks_beaches_continents'] = array(
    '#title' =&gt; 'Continents',
    '#description' =&gt; 'Taxonomy vocabulary defining Continents',
    '#type' =&gt; 'select',
    '#options' =&gt; iks_beaches_getTerms(variable_get(IKITESURF_BEACHES_CONTINENT, '')),
    '#required' =&gt; true,
    '#ajax' =&gt; array(
    'callback' =&gt; 'countryDisplay',
    'wrapper' =&gt; 'countryDisplay',
    'event' =&gt; 'change',
     ),
     );
    $form['countryDisplay']['iks_beaches_country']= array(
     '#type' =&gt; 'select',
     '#options' =&gt;iks_beaches_getTerms(variable_get(IKITESURF_BEACHES_REGIONS, '')),
     '#title' =&gt; 'Country',
     '#required' =&gt; true,
     '#description' =&gt; 'Taxonomy vocabulary defining Country',
     );
     $form['regionDisplay']['iks_beaches_regions'] = array(
     '#title' =&gt; 'Regions',
     '#description' =&gt; 'Taxonomy vocabulary defining Regions',
     '#type' =&gt; 'select',
     '#options' =&gt; iks_beaches_getTerms(variable_get(IKITESURF_BEACHES_REGIONS, '')),
     '#required' =&gt; true,
     );

     $form['countryDisplay'] = array(
     '#type' =&gt; 'markup',
     '#prefix' =&gt; '&lt;div id="countryDisplay"&gt;',
     '#suffix' =&gt; '&lt;/div&gt;',
     );


the corresponding ajax function is

 function countryDisplay($form, &amp;$form_state){
    $city = isset($form_state['values']['iks_beaches_continents']) ?        $form_state['values']['iks_beaches_continents'] : 'default';
    $query = new EntityFieldQuery();
    $entities = $query-&gt;entityCondition('entity_type', 'taxonomy_term')
                      -&gt;propertyCondition('vid', variable_get('iks_beaches_countries'))
                      -&gt;fieldCondition('field_continent', 'tid', $city)
                      -&gt;execute();
    if(isset($entities['taxonomy_term']) &amp;&amp; count($entities['taxonomy_term'])) {
    $countries = taxonomy_term_load_multiple(array_keys($entities['taxonomy_term']));       
    foreach($countries as $coutry){
   $options[$coutry-&gt;tid]=$coutry-&gt;name;
   }       
    }
    $form['countryDisplay']['iks_beaches_country'] = array(
         '#type' =&gt; 'select',
         '#options' =&gt; $options,
         '#title' =&gt; 'Country',
         '#required' =&gt; true,
         '#description' =&gt; 'Taxonomy vocabulary defining Country',        
        );
return  $form['countryDisplay'];
}


But countries value is not displaying on form submit

function iks_beaches_create_submit($form, &amp;$form_state) {
echo "&lt;pre&gt;";print_r($form_state['values']);echo "&lt;/pre&gt;";exit; }

Array
(
    [iks_beaches_continents] =&gt; 673
    [iks_beaches_regions] =&gt; 783
    [location_name] =&gt; hdnffgh 
    [description_location] =&gt; fgdh fgh fg hrt yry bnmbv mbcsd rty
    [travelling_details] =&gt; fh ty vcrsw t ytrywswe5
    [location_facilities] =&gt; ry  yuf d sdaf sa warewe svbvcber
    [tags] =&gt; e
    [longtitude] =&gt; 23.536343
    [latitude] =&gt; 45
    [images0] =&gt; 13803
    [images1] =&gt; 0
    [images2] =&gt; 0
    [images3] =&gt; 0
    [images4] =&gt; 0
    [images5] =&gt; 0
    [images6] =&gt; 0
    [images7] =&gt; 0
    [images8] =&gt; 0
    [images9] =&gt; 0
    [submit] =&gt; Publish Beach
    [form_build_id] =&gt; form-ZpuHlTPwSjJ2ElN_nPlSTsmHdQC6mmvSyKQOfMy4xvM
    [form_token] =&gt; n6vBuvZLJJNdcjdYERIsOm2REge8JoJMOSMmEuzpom8
    [form_id] =&gt; iks_beaches_create
    [op] =&gt; Publish Beach
)
Your mistake is a misconception about AJAX callback function. In Drupal, all permanent changes to a form needs to be done in form creation function, in your case iks_beaches_create. Function pointed in ['#ajax']['callback'] has the only purpose to determine what part of form is supposed to be updated. It can change $form, but these changes are one-time only, and preparing form to save values counts as a second time. Move all your form assembly logic to iks_beaches_create, so you could trim callback to

function countryDisplay($form, &amp;$form_state){
  return  $form['countryDisplay'];
}


and it will work.