Closed Bug 266786 Opened 20 years ago Closed 20 years ago

If the value is not specified in dropdown option, firfox uses text as the value

Categories

(SeaMonkey :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED INVALID

People

(Reporter: spottavathini, Unassigned)

References

()

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; .NET CLR 1.0.3705)
Build Identifier: Mozilla/5.0

If i have a dropdown like 
<select name=mySelect>
<option>--Select One</option>
<option value=1>One</option>
<option value=2>Two</option>
</select>
If i try to read the value of first option then it returns "--Select One" 
instead of "".



Reproducible: Always
Steps to Reproduce:
1.
2.
3.



Expected Results:  
Should always return blank when there is no value specified
value = cdata [CS]
    This attribute specifies the initial value of the control. If this attribute
is not set, the initial value is set to the contents of the OPTION element.

http://www.w3.org/TR/html401/interact/forms.html#edef-OPTION

So what you see is what is supposed to happen per the spec.  If you want the
value to be "", set it explicitly.

->Invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Interesting spec. It would be nice if it sets to blank instead of the text.
Oh well, we have to follow W3 standards.


(In reply to comment #1)
> value = cdata [CS]
>     This attribute specifies the initial value of the control. If this 
attribute
> is not set, the initial value is set to the contents of the OPTION element.
> http://www.w3.org/TR/html401/interact/forms.html#edef-OPTION
> So what you see is what is supposed to happen per the spec.  If you want the
> value to be "", set it explicitly.
> ->Invalid.

Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.