Open Bug 547925 Opened 14 years ago Updated 2 years ago

onchange attribute in the select element does not fire when option is selected

Categories

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

1.9.2 Branch
x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: princedudley, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6.3; .NET CLR 2.0.50727; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
Build Identifier: 3.6

<SELECT id=firstChoice name=firstChoice onchange="setCcode(this);" disabled>
<option>[SELECT0]</option>
<option>[SELECT1]</option>
<option>[SELECT2]</option>
<option>[SELECT3]</option>

function setCcode(control){
{
  if(control.selectedIndex!=0)
     document.myChoices.ccode.value=control[control.selectedIndex].text;        
   else
       document.myChoices.ccode.value="";
      }
}


form Name = myChoices
input textbox name = cccode

Reproducible: Always

Steps to Reproduce:
1. Create a select list with onchange attribute that calls a javascript function everytime the selected option is changed
2. The javascript function should change the value of a text box to follow the option value that has been selected in the select element
3. When the selected option is changed, the change is never reflected to the value that appears in the text box
Actual Results:  
1) Value in the text box is always blank and never changes to follow the option selected in the dropdown list (select element).

2) onchange event never fires when a different option is selected from the list


Expected Results:  
1) Text in the text box should change according to the selected option from the dropdown list
2) onchange should have called the javascript function when the option in the dropdown list was selected / changed to a different selection

This bug does not appear in IE.
This bug affects Firefox 3.5, 3.6 (able to be reproduced)
Version: unspecified → 3.6 Branch
Component: Build Config → DOM
Product: Firefox → Core
QA Contact: build.config → general
Version: 3.6 Branch → 1.9.2 Branch
A minimal testcase uploaded using "Add an attachment" would be great.
Severity: critical → normal
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven't been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.