Render form with ajax submit
Instead of print rendering the individual items, you can try to build your form using the drupal_get_form core function, which allows Drupal to add all the extra components to the form (including the Ajax call). 

So in your template it would like like this:

$output = drupal_get_form('mymodule_form');
print drupal_render($output);