Loading a form by ajax
Solution posted here:

basically:


  You need to generate the javascript settings for the form, and send
  them to the browser to be merged with the existing settings. Without
  doing this, any AJAX on your form will not work.


https://drupal.org/node/2009252