Hi there....

i have created a vocabulary with a hierachy like this

root1
 -sub1a
 -sub1b
 -sub1c
roo2
 -sub2a
 -sub2b
 -sub2c

etc.

It's a big vocabulary and i'm using autocomplete for user to choose, but I want to disable the possibility of selecting the root (parent) terms....

I have set it up this way because I need user to be able in a views to search by the root terms.....

How can I manage to disable the root terms in the edit/create form?

Comments

acoustika’s picture

I managed to get it to work with a select list with code like this

function my_form_form_alter(&$form, &$form_state, $form_id) { 
	if($form_id == "my_form") {
	unset($form['my_field']['und']['#options']['11']);
	
	}  
}

But how can I get it to work when I use autocomplete widget?