Select.options.length is read-only when it shouldn't be

VERIFIED DUPLICATE of bug 16879

Status

()

P3
normal
VERIFIED DUPLICATE of bug 16879
19 years ago
19 years ago

People

(Reporter: mjhans, Assigned: vidur)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
In javascript 1.1, you are supposed to be able to clear a select list by setting
.options.length=0 (quote O'Reilly p671 of "JavaScript definitive guide", "If you
set options.length to 0, all options in the Select object are cleared").

However, if you execute the following code, you will get the (incorrect) error:

	JavaScript Error: Error: document.F.G.options.length is read-only

There are quite a few sites (including one I'm working on) that make dynamic
menus this way.

Here is some code:

<BODY ONLOAD="clearSelect();">
<HTML>
<SCRIPT LANGUAGE="JAVASCRIPT1.1">

function clearSelect() {
document.F.G.options.length=0;
}
</SCRIPT>
<FORM NAME="F">
<SELECT NAME="G">
<OPTION VALUE="FOO">FOO
</SELECT>
</FORM>
</HTML>
</BODY>


-- Matt

Comment 1

19 years ago
This is a DOM issue. Reassigning.
Component: Core → DOM Level 0
Product: Rhino → Browser

Comment 2

19 years ago
Reassign to owner of DOM component.
Assignee: norris → vidur
QA Contact: cbegle → desale
(Assignee)

Comment 3

19 years ago

*** This bug has been marked as a duplicate of 16879 ***
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → DUPLICATE

Comment 4

19 years ago
verified dupe of bug 16879 "select.options.length should be read/write."
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.