I have a select box using the dropdownchecklist jquery plug-in. I want to have a change event fire only after the select box loses focus.
The jquery .change event fires for select boxes immediately upon selecting an item in the list. In my case since multiple items can be selected I only want the change to fire after focus is lost assuming new items were even selected.
I thought I could do some sort of chaining like $(‘#MySelect’).change().blur(…) or some kind of nesting or something, but I couldn’t really get it to work like I’d expect.
Any ideas?
Maybe you want to simply provide a handler for the blur event and ignore the change event altogether. You will then have to track changes yourself. One suggestion is to have the change event simply update a variable that tells you that changes took place without doing anything else. Then the blur event could do this: