How to fetch form state value of a form on clicking custom button?
In that case, you can create a container in the form, and fill it with the values after AJAX has been fired. Then you only need to return that container in your ajax callback.

if($form_id == 'user_register_form')
{
  $form['mybutton'] = array(
    // ...
    '#ajax' =&gt; array(
      'callback' =&gt; 'my_ajax_callback',
      'wrapper' =&gt; 'form_state_values_wrapper',
    ),
  );

  $form['form_state_values'] = array(
    '#prefix' =&gt; '&lt;div id="form_state_values_wrapper"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
    '#markup' =&gt; '',
  );

  if(isset($form_state_, $form_state['values']))
  {
    $form['form_state_values']['#markup'] = '&lt;pre&gt;' . print_r($form_state['values'], TRUE) . '&lt;/pre&gt;',
  }

}

function my_ajax_callback(&amp;$form, &amp;$form_state,$form_id) {
  return $form['form_state_values'];
}