Ajax Form to pull two different views I have two different views that need to be toggled on a node page.  I cannot put these two views together so I have created a form that will basically take the values of the form that I create, and send them as arguments to the view and display the view.  I am attempting to do with this ajax.  It works fine but the problem is the second time I run the form it does not refresh or update that view.

function photoflight_albums() {
    photoflight_gallery_themes();
  $output = render(drupal_get_form('photoflight_gallery_form'));
  $output .= "&lt;div id='gallery-ajax-wrapper'&gt;";
  $output .= views_embed_view('gallery', 'default');
  $output .= "&lt;/div&gt;";

  return $output;

}

//Grabs the node titles
function photoflight_gallery_themes(){
    $type = "photo_theme"; 
    $theme_list = array();
    $nodes = node_load_multiple(array(), array('type' =&gt; $type)); 
    foreach($nodes as $themes){
        $theme_list[$themes-&gt;title] = $themes-&gt;title;
    }
    return $theme_list;
}


//Form calls back to the function above to the gallery-ajax-wrapper div output above
    function photoflight_gallery_form($form, &amp;$form_state){
        $form = array();

  $form['themes'] = array(
    '#type' =&gt; 'select',
    '#options' =&gt; array(photoflight_gallery_themes()),
    '#ajax' =&gt; array(
            'callback' =&gt; 'photoflight_simplest_callback',
            'wrapper' =&gt; 'gallery-ajax-wrapper',
        ),
  );
  //debug($form);
  return $form;
}


//Ajax callback
function photoflight_simplest_callback($form, $form_state) {
    $view = views_get_view('gallery');
    $args = array( 'title' =&gt; $form_state['values']['themes']);
    $view-&gt;set_exposed_input($args);
    $output = $view-&gt;preview('default', $args);
    return array("#markup" =&gt; $output);

}
The issue was that it was removing the HTML element so the second call had no HTML to replace.  Changed to either use ajax update or on the call back wrap the return in the div again