how to set default value for taxonomy autocomplete field in drupal 7?

by Amit Kumar   Last Updated January 14, 2018 12:07 PM

I am using drupal 7. I have created a content type with autocompplete taxonomy field . I need to set default value programatically. I am using this code under hook_form_aler $form['field_school_locality_city_level'][LANGUAGE_NONE]['names']['#default_value'] = tid;

Its giving me just term id .. But I need this format Bhopal[tid:8193]

Tags : forms

Related Questions

Reuse form from another module in multistep form

Updated May 21, 2015 22:03 PM