Project:CCK Taxonomy Fields
Version:5.x-1.2
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Can someone explain to a newbie what the OptGroups option is all about? (It's visible when you are configuring a CCK Taxonomy field. I can't find documentation on that anywhere.

Thanks,
Mike

Comments

#1

Check this out: http://www.w3schools.com/tags/tag_optgroup.asp

However, I still have no clue how this works in CCK Taxonomy Fields...

#2

i have been searching for a definition and use case myself

Chris

#3

A use case would be to forbid users to select, say, the first level of a hierarchic taxonomy... for example in "Fruit > Apples" and "Fruit > Oranges" they could select the type of fruit but not "Fruit" itself.

In fact I need to do this right now for a project =) Will get back to you when I do it =)

#4

I have been looking for weeks on how to implement 'optgroups' in a CCK select field. Did you do it? can you elaborate how you did it? where are the options?

Thanks,
blue

#5

I went with Hierarchical Select module.

#6

how do i remove the opt groups from the rendered code:

this is my php:

$form['medicalaid'] = array(
'#type' => 'select',
'#title' => t('Medical Aid'),
'#options' => $medicalaidarr ,
'#attributes' => array('onchange' => 'getoptions(this)')
);

this is my rendered html:

<select name="medicalaid" onchange="getoptions(this)" class="form-select" id="edit-medicalaid">
<optgroup label="0"><option value="1">Discovery</option></optgroup>
<optgroup label="1"><option value="2">Momentum</option></optgroup>
<optgroup label="2"><option value="3">Bonitas</option></optgroup>
<optgroup label="3"><option value="4">Medshield</option></optgroup>
<optgroup label="4"><option value="5">FedHealth</option></optgroup>
<optgroup label="5"><option value="6">Nimas</option></optgroup>
<optgroup label="6"><option value="7">SpectraMed</option></optgroup>
<optgroup label="7"><option value="8">Resolution Health</option></optgroup>
<optgroup label="8"><option value="9">Old Mutual Oxygen</option></optgroup>
<optgroup label="9"><option value="10">Liberty</option></optgroup>
<optgroup label="10"><option value="11">Pharos</option></optgroup>
<optgroup label="11"><option value="12">Prosano</option></optgroup>
<optgroup label="12"><option value="13">Gems</option></optgroup>
<optgroup label="13"><option value="14">Medihelp</option></optgroup>
<optgroup label="14"><option value="15">Profmed</option></optgroup>
<optgroup label="15"><option value="16">Hosmed</option></optgroup>
<optgroup label="16"><option value="17">Bestmed</option></optgroup>
<optgroup label="17"><option value="18">Selfmed</option></optgroup>
<optgroup label="18"><option value="19">Ingwe</option></optgroup>
<optgroup label="19"><option value="20">Bankmed</option></optgroup>
<optgroup label="20"><option value="21">Genesis</option></optgroup>
<optgroup label="21"><option value="22">Motohealth</option></optgroup>
<optgroup label="22"><option value="23">Keyhealth</option></optgroup></select>

i SERIOUSLY dont want the optgroup elements there.

please can someone tell me how to turn off the optgroup options on '#type' => 'select' form items

nobody click here