August 9, 2005
Wishlist for the W3C (optgroup true grouping)
I’ve got an addition to my Christmas wishlist for the W3C pertaining to the tag optgroup, which is part of the select tag. Presently, you can only specify a label for the opt group.
Stellar idea/proposal: How about truly making this select tag have true groupings, so that you could actually retrieve both the value of the option selected, but the optgroup to which it belongs!?! This would mean adding a value or groupvalue attribute to the optgroup tag:
Example: <optgroup label="Group Name" value="groupid"></optgroup>
So referring to this form example…
… if you could not only grab the option value (e.g., “Package 1″, “Package 2″, etc.), but also grab it’s group value, think of how this would improve server-side scripting abilities!! You could add more dimension to the select form and be able to direct the posting of that form data.
For example: if I had two different invoicing tables (one for people who have hosting packages, and one for those who are receiving other services), I could direct the data to the appropriate table based on my selection. If I were creating an invoicing page, this could save me real estate on the page by condensing numerous form elements into one select field with numerous optgroups to choose from.
But until such a solution comes about, the optgroup tag is mearly an esthetic thing and of little value or power to the developer. Perhaps the W3C can make some great form innovations and come up with a great solution for this.

August 9, 2005, 11:20 am
Leave a Comment
You must be logged in to post a comment.

Filed under: 