Update webform field value using AJAX realtime
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'];
 }