Replace textfield value on ajax callback 1) Am i missing something here? it's not replacing the textfield value.
2) Also how do i replace if i have a multiple textfield and multiple button in a form.  

&lt;?php
    function test($form, &amp;$form_state) {
      if (isset($form_state['values']['your_name'])) {
        $name_value = $form_state['values']['your_name'];
      }
      else {
        $name_value = "";
      }

      $form = array();
      $form['your_name'] = array(
        '#title' =&gt; t('Your or your company name'),
        '#type' =&gt; 'textfield',
        '#value' =&gt; $name_value,
        '#prefix' =&gt; '&lt;div id ="subscribers-name"&gt;',
        '#suffix' =&gt; '&lt;/div&gt;',
      );
      $form['load_settings'] = array(
        '#type' =&gt; 'button',
        '#value' =&gt; t('Load my settings'),
        '#ajax' =&gt; array(
          'wrapper' =&gt; 'subscribers-name',
          'callback' =&gt; 'simplenews_mod_load_subscriptions_ajax',
          'method' =&gt; 'replace',
        )
      );
      return $form;
    }

    function simplenews_mod_load_subscriptions_ajax($form, &amp;$form_state) {
      $form_state['values']['your_name'] = "loaded value";
      return $form['your_name'];
    }
function test($form, &amp;$form_state) {
  $form['your_name'] = array(
    '#title' =&gt; t('Your or your company name'),
    '#type' =&gt; 'textfield',
    '#prefix' =&gt; '&lt;div id ="subscribers-name"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
  );
  if (isset($form_state['values']['your_name'])) {
    $form['your_name']['#value'] = 'if';
  }
  else {
    $form['your_name']['#value'] = 'else';
  }
  $form['load_settings'] = array(
    '#type' =&gt; 'button',
    '#value' =&gt; t('Load my settings'),
    '#submit' =&gt; 'simplenews_mod_load_subscriptions',
    '#ajax' =&gt; array(
      'wrapper' =&gt; 'subscribers-name',
      'callback' =&gt; 'simplenews_mod_load_subscriptions_ajax',
      'method' =&gt; 'replace',
    )
  );
  return $form;
}

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