utopia
utopia

Reputation: 177

Categories and subcategories in optgroup

I want to have a Hierarchical Data in select box with php:

enter image description here

But when I use optgroup, the <optgroup> couldnt have a value. Is there any way to have a Hierarchical Data like this image? Thanks in advance

Upvotes: 0

Views: 784

Answers (2)

symcbean
symcbean

Reputation: 48387

You've tagged this as php but it's not anything to do with PHP.

Optgroups don't have values - they have labels.

You might want to checkout phplm

Upvotes: 0

Wesley van Opdorp
Wesley van Opdorp

Reputation: 14951

Optgroup isn't selectable either.

I always use indenting with &nbsp; to create an hierarchical select box.

Upvotes: 1

Related Questions