Can someone explain to me when the onchange event is triggered in JS. Because I am making multiple drop-down lists where each one depends on the previous one's answer. But all the onchange events are firing, even though the selectItemIndex isn't changing...
Asked
Active
Viewed 2,748 times
1
-
1code example would be good – Jaromanda X Jul 09 '15 at 14:07
-
`onchange` event is triggered on an element when its value changes. To help you, you need to show us your code (relevant portions). – light Jul 09 '15 at 14:07
-
Show some code please. But I sounds like you are attaching the same event function to all the DDLs. – Dean.DePue Jul 09 '15 at 14:09
2 Answers
0
I found this
The onchange event occurs when the value of an element has been changed.
For radiobuttons and checkboxes, the onchange event occurs when the checked state has been changed.
Tip: This event is similar to the oninput event. The difference is that the oninput event occurs immediately after the value of an element has changed, while onchange occurs when the element loses focus. The other difference is that the onchange event also works on keygen and select elements.
you can see more here http://www.w3schools.com/jsref/event_onchange.asp
If you change the content of the dropdown you are also firing the onchange event.

Marco Mendão
- 329
- 2
- 5