Select's onSelect event doesn't work in IE and Chrome
Hi,
I'm using my custom component that has a combo box (jsf's h:selectOneMenu, which has a onselect event) in it and it already has a onchange event, so I want the onchange event to trigger another onselect event with jQuery and it only works in Firefox.
I tried it without the component and it looks like this:
- <html>
- <head>
- <script src="http://code.jquery.com/jquery-latest.min.js"></script>
- <script type="text/javascript">
- function select() {
- $('#customid').trigger('onselect');
- }
- </script>
- </head>
- <body>
- <div id="main">
- <select id="customid" onselect="alert('onselect');" onchange="select();">
- <option value="1" selected="true">one</option>
- <option value="2">two</option>
- <option value="3">three</option>
- <option value="4">four</option>
- </select>
- </div>
- </body>
- </html>
and again works only in Firefox, and not IE and Chrome. It works with onblur event, but the onselect is closer to what I need.
Is it not working because the html <select> tag doesn't have a select event but Firefox can do it for some reason?