IE Bug: onchange event not called when using <optgroup> in select drop-down

R

Ryan McGeary

In a <select> drop-down, the onchange event isn't called when
scrolling through the dropdown using the mouse-wheel and when crossing
over a new <optgroup>.

Using the example below, notice how the onchange event isn't called
when mouse wheel scrolling between A3 and B1, but it works properly
when scrolling between A1 and A2.

E.g.
------------------------------------------
<html>
<body onload="document.forms['myForm'].elements['mySelect'].focus()">

<form name="myForm" id="myForm">
<select onchange="alert('onchange event');" name="mySelect"
id="mySelect">
<optgroup label="Group A">
<option value="A1">A1</option>
<option value="A2">A2</option>
<option value="A3">A3</option>
</optgroup>
<optgroup label="Group B">
<option value="B1">B1</option>
<option value="B2">B2</option>
<option value="B3">B3</option>
</optgroup>
<optgroup label="Group C">
<option value="C1">C1</option>
<option value="C2">C2</option>
<option value="C3">C3</option>
</optgroup>
</select>
</form>

</body>
</html>
 
M

McKirahan

Ryan McGeary said:
In a <select> drop-down, the onchange event isn't called when
scrolling through the dropdown using the mouse-wheel and when crossing
over a new <optgroup>.

Using the example below, notice how the onchange event isn't called
when mouse wheel scrolling between A3 and B1, but it works properly
when scrolling between A1 and A2.

E.g.
------------------------------------------
<html>
<body onload="document.forms['myForm'].elements['mySelect'].focus()">

<form name="myForm" id="myForm">
<select onchange="alert('onchange event');" name="mySelect"
id="mySelect">
<optgroup label="Group A">
<option value="A1">A1</option>
<option value="A2">A2</option>
<option value="A3">A3</option>
</optgroup>
<optgroup label="Group B">
<option value="B1">B1</option>
<option value="B2">B2</option>
<option value="B3">B3</option>
</optgroup>
<optgroup label="Group C">
<option value="C1">C1</option>
<option value="C2">C2</option>
<option value="C3">C3</option>
</optgroup>
</select>
</form>

</body>
</html>


I'd never heard of "optgroup" before so I went looking.

I found it under WAP (Wireless Application Protocol ).

http://www.w3schools.com/wap/tag_optgroup.asp

does not indicate that "label=" is supported.
 
T

Thomas 'PointedEars' Lahn

McKirahan said:
[...]
<select onchange="alert('onchange event');" name="mySelect"
id="mySelect">
<optgroup label="Group A">
[...]
</optgroup>
[...]


I'd never heard of "optgroup" before so I went looking.

I found it under WAP (Wireless Application Protocol ).

http://www.w3schools.com/wap/tag_optgroup.asp

does not indicate that "label=" is supported.

`optgroup' is an element of valid HTML 4.01
Strict/Transitional as of *December 1999*.

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

You should update your knowledge from time to time.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top