How to validate and submit a form using AJAX?
I know this is question has been lying around for a couple of years by now, but I don't feel any of the other answers really get the point of Drupal 7 ajax form submission, so I'll try to explain it.
Since your form should work as well without the ajax as per good practice, your ajax submit handler should do nothing but return the form. Everything else should be in your validation and submit functions.
function ex_form($form, $form_state) {
  $form['name'] = array(
    '#type' =&gt; 'textfield',
     '#title' =&gt; t('Name'),
     '#default_value' =&gt; '',
     '#maxlength' =&gt; '128',
     '#required' =&gt; TRUE,
  );

  $form['submit'] = array(
   '#type' =&gt; 'submit',
   '#value' =&gt; 'Submit',
   '#ajax' =&gt; array(
     'callback' =&gt; 'ex_form_ajax_handler',
     'effect' =&gt; 'fade',
   ),
  );
}

function ex_form_submit(&amp;$form, &amp;$form_state) {
  // Submit logic - runs when validation is ok
  // You can alter the form here to be just a markup field if you want.
}

function ex_form_validate(&amp;$form, &amp;$form_state) {
  // Validation logic - invalidate using form_set_error() or form_error()
}

function ex_form_ajax_handler(&amp;$form, &amp;$form_state) {
  return $form;
}