title: Drupal.attachBehaviors not effect to returned ajax form
body: <p>I'm working on Drupal 7, I have a form constructed like this</p>
  
  <pre><code>function qt_debate_response_form($form, &amp;$form_state, $node_id){
  $form['node_id'] = array(
      '#type' =&gt; 'value',
      '#value' =&gt; $node_id,
  );
  $form['response_body'] = array(
      '#type' =&gt; 'textarea',
      '#required' =&gt; TRUE,
      '#row' =&gt; 4,
      '#default_value' =&gt; '',
  );
  $form['submit'] = array(
      '#type' =&gt; 'submit',
      '#value' =&gt; t('Post'),
      '#ajax' =&gt; array(
        'callback' =&gt; 'qt_debate_response_form_js',
        'wrapper' =&gt; 'response-message-' . $node_id,
        'method' =&gt; 'append',
        'effect' =&gt; 'fade',
      ),
  );
  return $form;
  }
  </code></pre>
  
  <p>And an ajax callback function to add new comment</p>
  
  <pre><code>function qt_debate_response_form_js($form, $form_state) {
  global $user;
  $body_text = $form_state['values']['response_body'];
  $node_id = $form_state['values']['node_id'];
  
  $message_js = '
  &lt;script language="javascript" type="text/javascript"&gt;
      qt_debate_response_load_new_item(' . $node_id . ',' . $user-&gt;uid . ');
  
      jQuery(".response-form-wrapper textarea").val("");
  &lt;/script&gt;';
  
  
  $comment = new stdClass();
  $comment-&gt;nid = $form_state['values']['node_id']; // Node Id the comment will attached to
  $comment-&gt;cid = 0;
  $comment-&gt;pid = 0;
  $comment-&gt;uid = $user-&gt;uid;
  $comment-&gt;is_anonymous = 0;
  $comment-&gt;homepage = '';
  $comment-&gt;status = COMMENT_PUBLISHED;
  $comment-&gt;language = LANGUAGE_NONE;
  $comment-&gt;subject = text_summary($body_text, null, 60);
  $comment-&gt;comment_body[$comment-&gt;language][0]['value'] = $body_text;
  $comment-&gt;comment_body[$comment-&gt;language][0]['format'] = 'filtered_html'; 
  comment_submit($comment);
  comment_save($comment);
  
  $output = $message_js;
  
  return $output;
  }
  </code></pre>
  
  <p>here are my Javascript that load new created comment into Div (ajax)</p>
  
  <pre><code>function qt_debate_user_post_load_new_items(debate_id) {
  // get the latest comment id in context
  $top_comment = jQuery(".view-debate-user-posts .views-row").first();
  $top_comment_id = jQuery(".nid-field-hidden", $top_comment).html();
  
  jQuery.ajax({
      type: "GET",
      url: "/qt_debate/ajax/load_new_items/" + debate_id + "/" + $top_comment_id,
      data: "",
      success: function(html){
          $new_items = jQuery(".view-content", html);
          jQuery("form", $new_items).attr("action","/debate/199");
          jQuery(".form-submit", $new_items).attr("id","edit-submit--5");
  
          if ($new_items.html() != null) {
              html = '&lt;div class="new_items_wrapper" style="display: none"&gt;' + $new_items.html() + '&lt;/div&gt;';
              if (jQuery(".view-debate-user-posts .view-content").length == 0) {
                  jQuery(".view-debate-user-posts .view-empty").remove();
                  jQuery(".view-debate-user-posts").append('&lt;div class="view-content"&gt;&lt;/div&gt;');
              }
  
              jQuery(".view-debate-user-posts .view-content").prepend(html);
  
              jQuery(".view-debate-user-posts .view-content .new_items_wrapper").fadeIn(500, function() {
                  jQuery(".views-row", this).unwrap();
                  Drupal.attachBehaviors();
              });
          }
      },
  });
  
  var t = setTimeout("qt_debate_user_post_load_new_items(" + debate_id + ")", 30000)
  }
  </code></pre>
  
  <p>The hook_menu which is return the views content to jQuery call back</p>
  
  <pre><code>function qt_debate_ajax_load_new_items() {
  $debate_id = arg(3);
  
  print views_embed_view('debate_user_posts_load_new_items_', 'default', array($debate_id));
  exit(0);
  }
  </code></pre>
  
  <p>View template file, i also return a new form inside</p>
  
  <pre><code>print drupal_render(drupal_get_form('qt_debate_response_form', $row-&gt;nid));
  </code></pre>
  
  <p>The return view content rendered good, with Drupal.attachBehaviors in Javascript, all others effect in returned view content also work well. Except the form submit ajax.</p>
  
  <p>Can any one help please ? The attachBehaviors not work with return ajax form.</p>
  
  <p>Thanks so much!</p>