How to change the button name after click on it using ajax
In hook form alter define your submit value . Below is small piece of code .

   $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Calculate'),
     '#prefix' =&gt; '&lt;div id="div-example"&gt;',
     '#suffix' =&gt; '&lt;/div&gt;',
    '#ajax' =&gt; array(
        'callback' =&gt; 'example_ajax_form_callback',
        'wrapper' =&gt; 'div-example',
         'method' =&gt; 'replace',
      ),
     );

function example_ajax_form_callback($form, &amp;$form_state) {
  $form['submit']['#value'] = 'New value';
    return $form['submit']; 
  }