Open GoogleCodeExporter opened 8 years ago
This is how I load the states
coming from ajax post
$.each(data, function (i, state) {
items += "<option value='" + state.Value + "'>" + state.Text + "</option>";
});
stateControl.html(items);
Original comment by geocip...@gmail.com
on 7 Jan 2011 at 2:00
looks like "change" event is monitoring the original selectbox and is not
changing the value of my original selectbox. Thus, no "change" is triggered
Original comment by geocip...@gmail.com
on 7 Jan 2011 at 2:52
Hi, old school adding of "change" events do work. but it doesn't seem to bind
to jquery "change" event.
//this does not work ----
$("#someID").change()
//this one works
var master = $("#someID");
// add/remove from http://ejohn.org/blog/flexible-javascript-events/ thanks
var addEvent = function (obj, type, fn) {
if (obj.attachEvent) {
obj['e' + type + fn] = fn;
obj[type + fn] = function () { obj['e' + type + fn](window.event); }
obj.attachEvent('on' + type, obj[type + fn]);
} else
obj.addEventListener(type, fn, false);
};
var masterEvent = function (event) {
alert("hello");
};
// listen for events on master old skool
addEvent(master[0], "change", masterEvent);
Original comment by geocip...@gmail.com
on 7 Jan 2011 at 6:49
Original issue reported on code.google.com by
geocip...@gmail.com
on 7 Jan 2011 at 1:46