10
rated 0 times
[
16]
[
6]
/ answers: 1 / hits: 30400
/ 11 Years ago, thu, august 1, 2013, 12:00:00
i am using select2.
Usage : if a value is COUNTRY
, i want to add a onchange event to the select2, else i want to remove the onchange event as shown below :
var reportLevel = getReportLevel();
if (reportLevel != COUNTRY) {
$(#selected_countries).on(change, function(e) {
prepareGlidModel(e);
});
} else {
$(#selected_countries).on(change, function(e) {
});
}
Issue : Not being able to remove the onchange event, even if the else block is called.
Events are called based upon the reportLevel
value selected in a dropdown
.
More From » jquery