Closed Bug 50376 Opened 24 years ago Closed 24 years ago

[MF][FIX][CBX]Cannot select with DOM option on dynamically created SELECT element

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: ken_mori, Assigned: rods)

References

Details

(Whiteboard: Fix in hand)

Attachments

(2 files)

From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
BuildID:    2000080712

Cannot select an option on a dynamically created Select element via JavaScript	
	

Reproducible: Always
Steps to Reproduce:
1. Create an select element
2. Add the select element to the document
3. Select an option							

Actual Results:  Desired option is not selected					
	

Expected Results:  Desired option is selected (IE5 works)
Attached file Click create combo
confirming. using the 2000082708 nightly on win2k
Status: UNCONFIRMED → NEW
Ever confirmed: true
I can se it with M17
Unreproducible with Build: 2000090104(M18)
Look like it's fixed :)
Marking as WORKSFORME
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → WORKSFORME
Mass update of qa contact
QA Contact: gerardok → janc
reopening. Asa & I are still seeing this with the 20000927 win32 builds.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
You are right, I can see it again with 2000092711
but I'm sure it worked fine with 2000090104, I'll download it and try again to
see if it's a regression or if it really never worked and I had a hallucination ;)
2000090104 is missing from the FTP :(
the oldest M18 build I can find is 2000091304, and the bug is reproducible with it.
Updating OS and Platform based on the reports of the folks at #mozillazine
Making the Sumary more clear(hope)
OS: Windows 2000 → All
Hardware: PC → All
Summary: Cannot select option on dynamically created SELECT element → Cannot select with DOM option on dynamically created SELECT element
Rod, I traced through what nsHTMLOptionElement::SetSelected() does and I don't
see any obvious problems, could you have a closer look at this?
Assignee: jst → rods
Status: REOPENED → NEW
The problem is the correct option gets set before the list intialized. When it 
is initialized a Reset is called and it loses it's value. I think the best thing 
to do in this situation is maybe to create a PresState.
Status: NEW → ASSIGNED
Summary: Cannot select with DOM option on dynamically created SELECT element → [CBX]Cannot select with DOM option on dynamically created SELECT element
Target Milestone: --- → Future
Why is this future? I know it isn't very critical, but it's a bug in DOM level 1
and IMHO it should be fixed before 1.0 I can't see any reason to no fix this for
1.0, if I'm wrong please tell me.
Future doesn't mean 'after 1.0', it means 'in the future'. For all practical
purposes, if the bug is assigned to a Netscape engineer (like this one) it 
means 'after Netscape 6.0 has shipped'.

If you think a bug must be fixed before, mozilla1.0, add the mozilla1.0 keyword
to the bug's keywords field.
Keywords: mozilla1.0
Sorry for my mistake.
Thanks Hixie for the clarification, but I understand that "all" the bugs are
going to be fixed 'in the future' so, what is the purpose of the future
Milestone(apart of the special mean in bugs assigned to NS engineers)? I
searched mozilla.org for a "future milestone" explanation but I failed to find
it, may be we need one, If some one is able to make me understand this I'll
write the explanation. Thanks again and sorry for the oftopic spam.
This is pretty important because you can't seem to select an option.  As this
and setting "selectedIndex" in the HTMLSelectElement is not available how are
you supposed to do it using DOM?
selectedIndex in HTMLSelectElement does work.  Sorry about that.
Summary: [CBX]Cannot select with DOM option on dynamically created SELECT element → [FIX][CBX]Cannot select with DOM option on dynamically created SELECT element
Whiteboard: Fix in hand
*** Bug 60088 has been marked as a duplicate of this bug. ***
Priority: P3 → P1
Target Milestone: Future → ---
Summary: [FIX][CBX]Cannot select with DOM option on dynamically created SELECT element → [MF][FIX][CBX]Cannot select with DOM option on dynamically created SELECT element
If you write in the testcase on line over
<pre>
		cur.selected=true;
</pre>
something like
<pre>
		var a=cur.selected;
</pre>
(var a=cur; is not enough!) or
<pre>
		var a=document.getElementsByID('option')[0];
</pre>
then the 
<pre>
		cur.selected=true;
</pre>
works for me! hmmm!
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Component: DOM Level 1 → DOM HTML
QA contact Update
QA Contact: janc → desale
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
verified ...works with the testcase
Status: RESOLVED → VERIFIED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: