Parabellum1905y / ufd

Automatically exported from code.google.com/p/ufd
GNU General Public License v2.0
0 stars 0 forks source link

changeOptions not working on IE6 #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I select USA as the country
2. call .udf("changeOptions") to that state select after ajax populate
3. state select is still disabled

What is the expected output? What do you see instead?
State should be repopulated as reflected on my original select element

What version of the product are you using? On what operating system?
0.6

I have a cascading dropdown populated via ajax country->state->county

Original issue reported on code.google.com by geocip...@gmail.com on 7 Jan 2011 at 1:46

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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