I am using a dropdown which displays several form fields after you choose something from the dropdown. I have bound the dropdown with jquery to detect a change, however, the box must ‘lose focus’ before the .change is triggered. Any way to fix this?
$("#EmployeeSelected").change(function () {
alert('hi');
});
It doesn’t appear to require losing focus, at least with an traditional change. If you are using another form of changing, ie keystrokes, you may want to consider binding additional events to it.
It should fire as you have it, as long as you are selecting it in the traditional sense (Clicking the option). If you are using a different method, such as keyboard input, you will need to bind the proper events to it, such as
keypress,keydown, etc.Working Demo