I am using Drupal 7. I have created a content type with autocomplete taxonomy field. I need to set default value programmatically.
I am using this code under hook_form_alter
:
$form['field_school_locality_city_level'][LANGUAGE_NONE]['names']['#default_value'] = tid;
It's giving me just term id
, but I need it in format Bhopal[tid:8193]
.