Skip to main content

Search and Top Navigation

#10636 closed bug (notabug)

Opened October 01, 2014 02:21PM UTC

Closed October 01, 2014 05:56PM UTC

add more evet listener on selectmenu

Reported by: janom Owned by:
Priority: minor Milestone: none
Component: ui.selectmenu Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:
Description

when change mySelect i got two alert, but when i change mySelectUi a got only second alert

<body>
<select id="mySelect" >
<option value="1">1111111</option>
<option value="2">2222222</option>
<option value="3">3333333</option>
</select>
<select id="mySelectUi" >
<option value="1">1111111</option>
<option value="2">2222222</option>
<option value="3">3333333</option>
</select>
<script type="text/javascript" >
jQuery("#mySelectUi").selectmenu();
function a1(event, ui){ alert("a1"); }
function a2(event, ui){ alert("a2"); }

document.getElementById("mySelect").addEventListener("change", a1);
document.getElementById("mySelect").addEventListener("change", a2);
jQuery("#mySelectUi").selectmenu({ change: a1 });
jQuery("#mySelectUi").selectmenu({ change: a2 });
</script>
</body>
Attachments (0)
Change History (2)

Changed October 01, 2014 03:07PM UTC by janom comment:1

Changed October 01, 2014 05:56PM UTC by scottgonzalez comment:2

resolution: → notabug
status: newclosed

The native change event and the custom change event are not the same thing. Please ask for help on the forums, IRC, or Stack Overflow.