This is a migrated thread and some comments may be shown as answers.

Combobox needs to be fired twice to work

0 Answers 104 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rich
Top achievements
Rank 1
Rich asked on 08 Oct 2012, 09:53 AM
Hi

I have three combo boxes (department, category and sub category), see attached jsfiddle example: http://jsfiddle.net/cFLQr/1/

When I select the second combobox (category) the change event is fired but, for some reason, if I then click then third combobox immediately (without any other interaction on the page) I get an error of "Cannot read property 'value' of undefined".

If however I do things slightly differently and select the second combobox (category) then make a click elsewhere on the page, the event is fired twice (once on change and once on click elsewhere on page). The second change event stops the above error and passes the correct information.

Please can you help me to understand why there is a second change event on clicking elsewhere on the page and also why the first change event doesn't do the job of the second change event. :-/

Thank you very much
Rich

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Rich
Top achievements
Rank 1
Share this question
or