...

View Full Version : option labels -- not yet



codegoboom
10-03-2004, 01:19 AM
From W3C HTML 4.01:

OPTION Attribute definitions

label = text [CS]

This attribute allows authors to specify a shorter label for an option than the content of the OPTION element. When specified, user agents should use the value of this attribute rather than the content of the OPTION element as the option label.


Umm... why are there little things like this that browsers do not implement...

Will they ever live up to the spec? :confused:

AaronW
10-03-2004, 03:05 AM
Wait, what?

Sounds like:

<option value="actual value">Shown Value</option>

Which actually does work in today's UAs...

codegoboom
10-03-2004, 03:37 AM
The label should be the shown value, according to the spec.

AaronW
10-03-2004, 12:39 PM
So what's the advantage to that then? I, and apparently most everyone else, have been getting along fine with what's available...

<option>This is the assumed value.</option>
<option value="This is the assumed value.">This is NOT the assumed value.</option>

codegoboom
10-03-2004, 09:27 PM
The W3C decided that such a feature was important, and should be implemented by user agents.

Here is their demonstration of its use:


In this example we use the OPTGROUP element to group choices. The following markup:



<FORM action="http://somesite.com/prog/someprog" method="post">
<P>
<SELECT name="ComOS">
<OPTION selected label="none" value="none">None</OPTION>
<OPTGROUP label="PortMaster 3">
<OPTION label="3.7.1" value="pm3_3.7.1">PortMaster 3 with ComOS 3.7.1</OPTION>
<OPTION label="3.7" value="pm3_3.7">PortMaster 3 with ComOS 3.7</OPTION>
<OPTION label="3.5" value="pm3_3.5">PortMaster 3 with ComOS 3.5</OPTION>
</OPTGROUP>
<OPTGROUP label="PortMaster 2">
<OPTION label="3.7" value="pm2_3.7">PortMaster 2 with ComOS 3.7</OPTION>
<OPTION label="3.5" value="pm2_3.5">PortMaster 2 with ComOS 3.5</OPTION>
</OPTGROUP>
<OPTGROUP label="IRX">
<OPTION label="3.7R" value="IRX_3.7R">IRX with ComOS 3.7R</OPTION>
<OPTION label="3.5R" value="IRX_3.5R">IRX with ComOS 3.5R</OPTION>
</OPTGROUP>
</SELECT>
</FORM>


represents the following grouping:



None
PortMaster 3
3.7.1
3.7
3.5
PortMaster 2
3.7
3.5
IRX
3.7R
3.5R



Does it actually work? No! Why? Because nobody bothered to implement it.

AaronW
10-03-2004, 09:35 PM
I'm lost.

http://www.offtone.com/scripts/optgroup.html

Seems to work for me. What exactly is the problem?

Edit:

Oh I see... Label on <option>, not colgroup...

Wait, so, wtf? Why on earth would you want to do that? The <option> tag's contents then become useless, no?

codegoboom
10-03-2004, 09:39 PM
Why on earth would we want to have any features from the standard? :rolleyes:

AaronW
10-03-2004, 09:43 PM
Dude, you aren't following... User Agents didn't implement it because it's redundant. Why would you want to do that? I'll change my mind if you can detail one situation where it'd be useful to do this...

Much like a:link (also a standard) it's redundant.

codegoboom
10-03-2004, 10:08 PM
The WDG provides detailed reasoning, here:
http://www.htmlhelp.com/reference/html40/forms/option.html

Redundancy is a good thing, btw; it reduces the likelihood of failure.

AaronW
10-03-2004, 10:55 PM
Ah, so it's there just for backward compatibility. Not sure why it was left out, as it'd be easy to do, but I bet that example of why it'd be useful wasn't in the spec, so UA makers were as baffled as I was as to why it'd ever be used :S

codegoboom
10-03-2004, 11:06 PM
Imagine a day when developers stop second guessing the spec., and give us a full implementaion. (I bet that never happens, the fools...)

AaronW
10-03-2004, 11:08 PM
The spec is huge. If they implemented everything, I wonder how big browsers would be... I'd like to think they implement what's most likely to be used, and which bits are being asked for the most (which are probably the same bits.)

codegoboom
10-04-2004, 01:05 AM
Half-assed implementations are the whole problem... ok, that's enough complaining on my part. ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum