Skip to content

Conversation

@christianz
Copy link

Call el.off("change") if .data("sl") is true.

I have two selects on my page, and need to change the available option in the second select based on what's chosen in the first select. After an option is chosen on the first select, I call .selectify() on the second select to update its list of items.

This alteration ensures that we don't hook up two "change" events to the same element if selectify() is called multiple times on the same .

Call el.off("change") if .data("sl") is true.

I have two selects on my page, and need to change the available option in the second select based on what's chosen in the first select. After an option is chosen on the first select, I call .selectify() on the second select to update its list of items.

This alteration ensures that we don't hook up two "change" events to the same element if selectify() is called multiple times on the same <select>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant