Opened 12 years ago

Closed 12 years ago

#4330 closed defect (fixed)

xhrGet not working with select multiple in a form

Reported by: James Burke Owned by: James Burke
Priority: high Milestone: 1.0
Component: General Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

Passing a form to xhrGet that has a select with the multiple attribute does not send a value for that element.

Some discussion here: http://dojotoolkit.org/forum/dojo-core-dojo-0-9/dojo-core-support/xhrget-form-not-passing-forms-select

Change History (4)

comment:1 Changed 12 years ago by guest

The problem is with the

dojo.query("option[selected]", item).forEach(function(opt){
    ria.push(opt.value);
});

the dojo.query option[selected] is not returning anything. If this is changed to

dojo.query("option", item).forEach(function(opt){
    if (option.selected) {
        ria.push(opt.value);
    }
});

then everything works as expected.

comment:2 Changed 12 years ago by James Burke

Owner: changed from James Burke to alex

Alex, does dojo.query need to be fixed, or should I just detect option.selected in the forEach? Assign it back to me if I should just change the forEach logic.

comment:3 Changed 12 years ago by James Burke

Owner: changed from alex to James Burke

I think the problem is if the selects are set via javascript, then the DOM may not have selected attribute, and the query would fail. I'm doing other formToObject changes so I'll take this one.

comment:4 Changed 12 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [10458]) Fixes #4259 and #4330. Fixes for form values with multiple names and for selects with multiple selected options

Note: See TracTickets for help on using tickets.