Submit AJAX form and update database then show all database results Is what i am trying to do is on this page it will display all items from the database that currently exist. Then at the top of this list will be a small form that will allow someone to add an item to the list. After someone submits the data and posts the form I want the list below to automatically populate with the updated data. I am having a really hard time trying to figure this out.

function clay_mod_blacklist_form($form, &amp;$form_state) {
drupal_add_css(drupal_get_path('module', 'clay_mod') . '/css/clay_mod.min.css');
drupal_add_js(drupal_get_path('module', 'clay_mod') . '/js/jquery.maskedinput.js');
drupal_add_js(drupal_get_path('module', 'clay_mod') . '/js/clay_mod.js');


$form['company'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Company Name'),
    '#required' =&gt; TRUE
);
$form['name'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Contact Name'),
    '#required' =&gt; TRUE
);
$form['phone'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Phone'),
    '#required' =&gt; TRUE
);
$form['email'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Email'),
    '#required' =&gt; TRUE
);
$form['submit_button'] = array(
    '#type' =&gt; 'button',
    '#submit' =&gt; array('clay_mod_blacklist_form_submit'),
    '#ajax' =&gt; array(
        'callback' =&gt; 'clay_mod_blacklist_form_ajax',
        'wrapper' =&gt; 'box',
        'method' =&gt; 'after'
    ),
    '#value' =&gt; t('Add To Blacklist'),
    '#id' =&gt; 'ajax-save-form-values'
);

$form['results'] = array(
    '#type' =&gt; 'container',
    '#prefix' =&gt; '&lt;div class="customShit" id="box"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;'
);

if(isset($form_state['values'])) {
    $form['results'][] = $form_state['values']['results'];
}
// This is where I was display info from database before the form was submitted
//    if(!empty($form_state['values']['results'])) {
//        $form['results'] = $form_state['values']['results'];
//    } else {
//        $rows = db_select('blacklist', 't')
//            -&gt;fields('t')
//            -&gt;execute()
//            -&gt;fetchAll();
//        foreach($rows as $k =&gt; $v) {
//            $form['results'][$k]['#markup'] = "&lt;div    class=\"vvvvvvvvv\"&gt;x{$v-&gt;name}y&lt;/div&gt;";
//        }
//    }



return $form;
}
function clay_mod_blacklist_form_ajax($form, $form_state) {
    return $form['results'];
}
function clay_mod_blacklist_form_submit($form, $form_state) {
   ddl('ajax submit');
   $form_state['rebuild'] = TRUE;
   clay_mod_blacklist_form_save($form, $form_state);

}
function  clay_mod_blacklist_form_save(&amp;$form, &amp;$form_state) {
$companyName = $form_state['values']['company'];
$name = $form_state['values']['name'];
$phone = $form_state['values']['phone'];
$email = $form_state['values']['email'];
$query = db_insert('blacklist')
    -&gt;fields(array(
        'company_name' =&gt; $companyName,
        'name' =&gt; $name,
        'phone' =&gt; $phone,
        'email' =&gt; $email,
    ))-&gt;execute();
}
Add a wrapper around the entire form, and return the entire form from your ajax callback. Then just build the rows reguarly in your form definition - The newly added rows will be shown since all the data is pulled from the database when the from is generated.

function clay_mod_blacklist_form($form, &amp;$form_state) {
  $form['#prefix'] = '&lt;div id="clay_mod_blacklist_form_wrapper"&gt;;
  $form['#suffix'] = '&lt;/div&gt;';

  // Add the rest of your form definition here

  $form['submit_button'] = array(
    '#type' =&gt; 'button',
    '#submit' =&gt; array('clay_mod_blacklist_form_submit'),
    '#ajax' =&gt; array(
      'callback' =&gt; 'clay_mod_blacklist_form_ajax',
      'wrapper' =&gt; 'clay_mod_blacklist_form_wrapper',
      'method' =&gt; 'after'
    ),
    '#value' =&gt; t('Add To Blacklist'),
  );

  $rows = db_select('blacklist', 't')
    -&gt;fields('t')
    -&gt;execute()
    -&gt;fetchAll();
  foreach($rows as $k =&gt; $v) {
    $form['results'][$k]['#markup'] = "&lt;div    class=\"vvvvvvvvv\"&gt;x{$v-&gt;name}y&lt;/div&gt;";
}

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