Programmatically loaded taxonomy form ajax errors I load a taxonomy term in the edit form via the following code:

module_load_include ( 'inc', 'taxonomy', 'taxonomy.admin' );
$vocabulary = taxonomy_term_load ( $tid );
$form = drupal_get_form ( 'taxonomy_form_term', $vocabulary );


The vocabulary has a custom text field with unlimited values, so this appears on the form, but when I click the "add another item" button, I get:


  Call to undefined function, taxonomy_form_term_validate() in [truncated path].../form.inc" on line 1513.




I appreciate any guidance I can get in solving this.
This function worked for me:
Please try to use form_load_include() and drupal_build_form() instead of drupal_get_form() to generate form

  $form_id = 'taxonomy_form_term';
  $vocabulary = taxonomy_vocabulary_load($tid);

  $form_state = array();
  $form_state['build_info']['args'] = array($vocabulary);

  // use form_load_include() and drupal_build_form() instead of drupal_get_form()
  form_load_include($form_state, 'inc', 'taxonomy', 'taxonomy.admin');

  $form = drupal_build_form($form_id, $form_state);