Update webform field value using AJAX realtime I have a webform created using the admin panel and would like to change one of its textfield values on click of a button. I have attempted doing this from hook_form_alter. I have given the wrapper name 'changeText' for this textfield from admin panel.

function fence_quote_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    if ($form_id == 'webform_client_form_1'){
        $form['buttons']['fence_quote']  = array(
          '#type' =&gt; 'button',
          '#value' =&gt; t('Get online estimates'),
          '#ajax' =&gt; array(
              'callback' =&gt; 'fence_quote_form_callback', 
              'wrapper' =&gt; 'changeText',
          ),
        );
       $form['field_meters']['#prefix'] = '&lt;div id="changeText"&gt;';
       $form['field_meters']['#sufix'] = '&lt;/div&gt;';
    }   
}

function fence_quote_form_callback($form, &amp;$form_state) {
   $form_state['values']['field_meters']['und'][0]['value'] = '111';
   return $form['wrapper'];
}


The problem is I can't update 'meters' value using AJAX callback as it is a field created from admin panel and not from hook_form_alter. However if I place

$form['submitted']['meters']['#default_value'] = '111'; 


outside of the callback it works on page refresh. How can I do this?



As requested by @kamal-oberoi I'm uploading a screenshot of my full code.
add wrapper to your text field which you want to update.

 function fence_quote_form_alter(&amp;$form, &amp;$form_state, $form_id) {
if ($form_id == 'webform_client_form_1'){
    $form['buttons']['fence_quote']  = array(
      '#type' =&gt; 'button',
      '#value' =&gt; t('Get online estimates'),
      '#ajax' =&gt; array(
          'callback' =&gt; 'fence_quote_form_callback', 
          'wrapper' =&gt; 'changeText',
      ),
    );
    /* Please add Wrapper to text_field */
    $form['wrapper']['your_textfield_name']['#prefix'] = '&lt;div id="changeText"&gt;';
    $form['wrapper']['your_textfield_name']['#sufix'] = '&lt;/div&gt;';
  }  

}


function fence_quote_form_callback($form, &amp;$form_state) {
     $form_state['values']['meters']['und'][0]['value'] = '111';
     return $form['wrapper'];
 }