By umanda on
I have a Taxonomy field and its gives me drop down list box. It has following html structure.
<select id="edit-taxonomy-4" class="form-select" name="taxonomy[4]">
<option value="">- None selected -</option>
<option value="1">Option A</option>
<option value="2">Option B</option>
</select>By default "- None selected -" option is display as a default selected value. I need to remove or hide it. and I need to put "Option A" or "Option B" as a default selected value.
What I need
<select id="edit-taxonomy-4" class="form-select" name="taxonomy[4]">
<option value="1" >Option A</option>
<option value="2">Option B</option>
</select>How I do that. please help me.
Thank you all.
Umanda Jayobandra
Comments
hook_form_alter
Have you tried hook_form_alter?
http://www.lullabot.com/articles/modifying-forms-drupal-5-and-6
It lets you modify every form in Drupal. You need to write a small module for it with the alter hook in it or you can use this module
http://drupal.org/project/form_alter_ui
another way would be to use jquery to hide the first element.
whatever you feel more comfortable with.
Thank you very much
Thank you very much
I ll try....