I have a term reference field in my content type. I'd like to be able to access the vocabulary items from that field in a custom module so I can pre-select one based on a users selection of an item from a field list. How is this possible?
An example might help illustrate the problem:
Content type: resource field 1: Category (field list) field 2: Group (term reference, hidden)
User selects one of eight options in the 'field 1' drop down select box. Selections include things like 'paper', 'metal', 'stone', etc.
The hidden 'Group' field detects which selection the user made above and auto-fills itself by selecting the vocabulary item in the associated taxonomy that maps to the selection they made. There are only three possibilities for 'Group' however so I'd also have to specify in the module WHICH selections from the field list map to which terms from the taxonomy to make sure the selections are correct.
For example, if a user selects 'paper' in the field list then Group should auto-select the term 'recyclable' before saving the record.
Anyone know how to do this?
I was going to approach it with hook_form_alter and hook_node_presave...but I'm not very comfortable with coding in modules yet.