How can I delete/hide any option from select box? (options are genereted from db, in db they must stay)

Comments

aaakkk’s picture

i know i must use this hook, but how...?

WorldFallz’s picture

<sigh>, that's not the question you asked. First see the existing documentation:

http://drupal.org/node/1702628
http://drupal.org/node/651106

Then click on some of the actual examples on the api.drupal.org page.

Then, if you still have questions, as specific questions that actually reflect what you want to know.

nevets’s picture

What generates the select box?

aaakkk’s picture

I have this form:

<select id="edit-field-cat" name="field_cat" class="form-select">
	<option value="_none">- - - - -
	</option>
	<option value="20">AAA
	</option>
	<option value="46">BBB
	</option> 
</select>

Select list is a Term reference field type. Options AAA and BBB are taxonomy terms, I don't want delete them from database. I don't want to show AAA option in the select list. How can I use hook form alter?

nevets’s picture

While it will do more, Taxonomy Access can be used to limit the ability to add/use certain terms.

aaronbauman’s picture

has anyone tried this module?
http://drupal.org/project/option_trim

i haven't tried, but it looks promising.