Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#7529 closed defect (fixed)

dijit.form.MultiSelect clobbers name attribute

Reported by: Josh Trutwin Owned by: Nathan Toone
Priority: high Milestone: 1.2
Component: Dijit - Form Version: 1.1.1
Keywords: dijit.form.MultiSelect name POST Cc:
Blocked By: Blocking:

Description

I created a MultiSelect? with:

<select id="field_65" name="company_4_65[]" dojoType="dijit.form.MultiSelect?" size="10" MULTIPLE style="width: 250px;">

After parsing this was changed into this (inspected from FireBug?):

<select dojoattachevent="onchange: _onChange" dojoattachpoint="containerNode,focusNode" multiple="true" id="field_65" style="width: 250px;" tabindex="0" size="10" widgetid="field_65" class="">

The "name" attribute is gone, which results in no data registered in $_POST in php server code making this form field invisible to the backend.

I also tested without the brackets [] at the end of the name, same result.

Tested with: Firefox 2 browser on Linux, LAMP stack with PhP 5.2 on backend.

Thanks,

Josh

Attachments (1)

MultiSelect-name.patch (652 bytes) - added by Josh Trutwin 11 years ago.
Patch against trunk to add name to templateString

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by Josh Trutwin

This behavior is also true on the dijit/tests/form/test_MultiSelect.html test file:

<select id="select3" multiple="true" name="select3"

dojoType="dijit.form.MultiSelect?" style="height:200px; width:175px; border:5px solid #ededed;">

becomes:

<select dojoattachevent="onchange: _onChange" dojoattachpoint="containerNode,focusNode" multiple="true" id="select3" style="border: 5px solid rgb(237, 237, 237); height: 200px; width: 175px;" tabindex="0" size="7" widgetid="select3" class="">

name="select3" no longer present.

comment:2 Changed 11 years ago by Josh Trutwin

adding this to templateString:

name="${name}"

fixes this issue, but not sure if that causes other problems?

Changed 11 years ago by Josh Trutwin

Attachment: MultiSelect-name.patch added

Patch against trunk to add name to templateString

comment:3 Changed 11 years ago by bill

Owner: set to Nathan Toone

Yah, seems good. You would think that "name" would go in attributeMap but it doesn't in other widgets; apparently for some browsers it needs to be set initially rather than afterwards, or the form doesn't submit right.

comment:4 Changed 11 years ago by Nathan Toone

Resolution: fixed
Status: newclosed

(In [14966]) Fixes #7529 - add name to the node so that submitting works correctly - thanks for the patch!

comment:5 Changed 11 years ago by bill

Milestone: tbd1.2

comment:6 Changed 11 years ago by Douglas Hays

(In [15253]) References #7529. Fix Multiselect test so that Submit button does something.

comment:7 Changed 9 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.