Ajax Forms created by Ajax Drupal 7 ERROR JAVASCRIPT
I found this way to resolve it. Creating another form whose submit return the form that i want. The code is:

function my_module_botton_create_form($form, &amp;$form_state) {
    $form['create_form'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; '',
        '#ajax' =&gt; array(
            'callback' =&gt; "my_module_to_create_form",
            'wrapper' =&gt; "new_acomp_form",
            'method' =&gt; 'replace',
            'effect' =&gt; 'fade',
          ),
    );

    return $form;
}

function my_module_to_create_form($form, &amp;$form_state) {

    $form=drupal_get_form("my_module_acomp_form");

        $output = array(
            '#type' =&gt; 'ajax',
            '#commands' =&gt; array(
                array('command' =&gt; 'ajax_create_form_acomp', 'data' =&gt; drupal_render($form)),
            ),
        );

        return $output;
}

function my_module_acomp_form($form, &amp;$form_state) {

    ...

    return $form;
}


The JS is

Drupal.ajax.prototype.commands.ajax_create_form_acomp = function (ajax, response, status) {
    $('#new_acomp_form').replaceWith(response.data+"&lt;div id='new_acomp_form'&gt;&lt;/div&gt;");
    //Drupal.behaviors.hcat_my_account.check_if_attendant_exits();
};