Form AJAX - Update button value via Ajax I have a custom form in Drupal that ties into Entity-generating code. In essence, there's a button which should return an ideal Entity state (determined in a method that returns true or false).

The code below fires the method in question, but even if it gets a return value from the method, the value of the button never changes.

Am I overlooking something as simple as returning a new #value in the AJAX callback?

function example_mark_block_form($form, $form_state) {
  $form = array();

  $is_marked = _example_is_user_marked();

  $form['mark-changes'] = array(
    '#type' =&gt; "button",
    '#id' =&gt; "mark-changes",
    '#default_value' =&gt; t($is_marked),
    '#prefix' =&gt; "&lt;div class='mark-wrapper'&gt;",
    '#suffix' =&gt; "&lt;/div&gt;",
    '#ajax' =&gt; array(
      'callback' =&gt; 'example_mark_follow_ajax_response',
      'wrapper' =&gt; 'mark-wrapper',
      'method' =&gt; 'replace',
    ),
  );

  return $form;
}

/**
 * AJAX callback for the follow response
 */
function example_mark_follow_ajax_response($form, $form_state) {
  global $user;

  return $form['mark-changes'];
}
From the FAPI Reference:

#ajax['wrapper']
This property defines the HTML id attribute of an element on the page which will be replaced by the html returned by the #ajax['path'] or #ajax['callback'] function. Usually, a div element is used as the wrapper, as it provides the most flexibility for placement of elements before, after, or inside of its HTML tags. This property is required for using AJAX requests in on a form element.  Note that the entire element with this ID is replaced, not just the contents of the element.

So this:
'#prefix' =&gt; &quot;&lt;div class='mark-wrapper'&gt;&quot;,

Should be:
'#prefix' =&gt; &quot;&lt;div id='mark-wrapper'&gt;&quot;,

Also buttons don't have a #default_value, so replace:
'#default_value' =&gt; t($is_marked),

with:
'#value' =&gt; t('@value', array('@value' =&gt; $is_marked)),

And you should be on track (the change to t() is just for sanitisation, see Translating Variables).