Selected value from combo box only picks "value" and not other field in java script.

RESOLVED INVALID

Status

()

Core
Layout: Form Controls
RESOLVED INVALID
10 years ago
7 years ago

People

(Reporter: Rajeev, Unassigned)

Tracking

1.9.2 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9

If we are using the select of html and call any java script function and try to look for second field which is passes in options[index], we get undefined value in firefox while in IE we get proper value


Reproducible: Always

Steps to Reproduce:
1. Save following html in test.html

<html>
<script>
function update(select)
{
     i = select.selectedIndex;
     id = select.options[i];
     alert("This is test , value is " + id.value + " second value is " + id.secondValue);
     
     
}
</script>

<div>
<select onChange=update(this)>
<option value="option1" secondValue = "1">option1</option>
<option value="option2" secondValue = "2">option2</option>
<option value="option3" secondValue = "3">option3</option>
<option value="option4" secondValue = "4">option4</option>
<option value="option5" secondValue = "5">option5</option>
</select>
</div> 
</html>

2. Open above file in Firefox as well as IE 7.0 and Select option2 from drop down menu.


Actual Results:  
Internet Explorer 7.0 shows correctly "second value is option2" while firefox shows "second value is undefined"

Expected Results:  
Firefox should have also shown "second value is option2"
(Reporter)

Updated

10 years ago
Summary: Selected value from combo box only picks values and not other field in java script. → Selected value from combo box only picks "value" and not other field in java script.
(Reporter)

Comment 1

10 years ago
Expected Results:  
Firefox should have also shown "second value is 2"
This bug was originally reported on Firefox 2.x or older, which is no longer supported and will not be receiving any more updates. I strongly suggest that you update to Firefox 3.6.6 or later, update your plugins (flash, adobe, etc.), and retest in a new profile. If you still see the issue with the updated Firefox, please post here. Otherwise, please close as RESOLVED > WORKSFORME
http://www.mozilla.com
http://support.mozilla.com/kb/Managing+profiles
http://support.mozilla.com/kb/Safe+mode
Whiteboard: [CLOSEME 2010-07-30]
Version: unspecified → 2.0 Branch
No reply, INCOMPLETE. Please retest with Firefox 3.6.8 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INCOMPLETE
(Reporter)

Comment 4

7 years ago
Tried above testcase on 3.6.8 and even in 3.6.8 it is reproducible and not fixed.
(Reporter)

Updated

7 years ago
Version: 2.0 Branch → 3.6 Branch
Please create an HTML file with that testcase and attach it to the bug.
Status: RESOLVED → UNCONFIRMED
Component: General → Layout: Form Controls
Product: Firefox → Core
QA Contact: general → layout.form-controls
Resolution: INCOMPLETE → ---
Whiteboard: [CLOSEME 2010-07-30]
Version: 3.6 Branch → 1.9.2 Branch
(Reporter)

Comment 6

7 years ago
Created attachment 468062 [details]
This file could be used to reproduce this issue as per in bug filing instructions

Added the html file that would demonstrate the bug
This is invalid, sorry.  IE maps all content attributes into the DOM, but the current specs forbid doing that.  If you want to get random unmapped attributes (which is most of them), you should be using getAttribute().
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.