Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#8484 closed defect (fixed)

form widgets submit values even if name is not specified

Reported by: Douglas Hays Owned by: Douglas Hays
Priority: high Milestone: 1.3
Component: Dijit Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

The form widgets have name="${name}" in their templates. This causes values to be submitted to the server even when there's no name value set. This can cause too much data to be sent on the wire, and can confuse server agents. This is a regression from 1.1.

Attachments (2)

8484.patch (11.8 KB) - added by Douglas Hays 11 years ago.
fix to be reviewed
8484_attrMap.patch (12.1 KB) - added by Douglas Hays 11 years ago.
alternate fix using Bill's changes to buildRendering/attributeMap - added benefit of removing _displayed_ value submitted on IE

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by Douglas Hays

Attachment: 8484.patch added

fix to be reviewed

comment:1 Changed 11 years ago by bill

This was originally from #8117 but I closed that as a duplicate (even though it's actually the original ticket).

Changed 11 years ago by Douglas Hays

Attachment: 8484_attrMap.patch added

alternate fix using Bill's changes to buildRendering/attributeMap - added benefit of removing _displayed_ value submitted on IE

comment:2 Changed 11 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

[16468] Fixes #8484. Add _setNameAttr method to _FormWidget that sets the name attribute on either valueNode/focusNode/domNode. Change buildRendering so that the widget domNode is not added until after _applyAttributes since name cannot be removed once in the DOM on IE. Changed _MappedTextBox so that there's no displayed text field submitted for IE users.

comment:3 Changed 11 years ago by bill

(In [16474]) Remove obsolete comments, refs #8484 !strict

comment:4 Changed 11 years ago by Douglas Hays

(In [16476]) References #8484. Remove name from Button attributeMap.

comment:5 Changed 11 years ago by bill

(In [16716]) Setting the name attribute after the widget DOM is created, even though it's not attached to <body>, causes subtle problems on IE. Specifically, dojo.query() and getElementsByTagName() don't work. (Even though form submission and dojo.attr(node, 'name') still do work.)

Rollback [16468] and [16474], and implement different solution.

Fixes #8660, #8671, refs #8484 !strict.

comment:6 Changed 11 years ago by Nathan Toone

(In [16785]) Refs #8660, #8671, #8484 - make this change for some of the dojox forms as well to read from the ${nameAttrSetting} value !strict

comment:7 Changed 7 years ago by bill

In [30156]:

Windows 8 Store Apps throw an exception when trying to set an element's name attribute via innerHTML. So avoid doing that on Windows 8 Apps. Instead, do it via the _setNameAttr custom setter. This is how it should be done for all platforms starting in 2.0.

Old code to set name via innerHTML was left in place for supporting the older versions of IE (refs #8660, #8484). Also, this.nameAttrSetting needs to be remain until 2.0 for backwards compatibility, because custom widgets may be referencing it in their templates.

Changes were tested locally on firefox by changing the conditions in _FormWidget.js and MappedTextBox.js from !has("win8app") to has("ie").

Fixes #16452 !strict.

Note: See TracTickets for help on using tickets.