Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#4905 closed defect (fixed)

IE7: DateTextBox submitting muliple values for one 'name'

Reported by: Adam Peller Owned by: Douglas Hays
Priority: high Milestone: 1.0
Component: Dijit - Form Version: 0.9
Keywords: Cc: Adam Peller, haysmark
Blocked By: Blocking:

Description (last modified by Adam Peller)

reposted from http://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/datetextbox-submitting-muliple-values-ie-only

works fine in FF, but not in IE7

<html>
        <head>
                <title>Simple Date Form</title>
                <link href="dojo/resources/dojo.css" type="text/css" rel="stylesheet"/>
                <link href="dijit/themes/tundra/tundra.css" type="text/css" rel="stylesheet"/>
                <script src="dojo/dojo.js" type="text/javascript" djConfig="parseOnLoad: true"></script>
                <script type="text/javascript">
                        dojo.require("dijit.form.DateTextBox");
                </script>
        </head>
        <body class="tundra">
                <form>
                        Select a date:
                        <input type="text" dojoType="dijit.form.DateTextBox" name="mydate" />
                        <input type="submit" value="go" />
                </form>
        </body>
</html>

Sample result query string: "?mydate=10%2F27%2F07&mydate=2007-10-27"

Change History (10)

comment:1 Changed 12 years ago by Adam Peller

Description: modified (diff)
Summary: DateTextBox submitting muliple values for one 'name'IE7: DateTextBox submitting muliple values for one 'name'

comment:2 Changed 12 years ago by bill

I looked at this a bit; I'll grab the bug if Doug isn't already working on it.

As per _FormWidget::attributeMap, name gets assigned to the displayed <input> field, and then MappedTextBox? mixin tries to move the name attribute to the hidden <input> field, but the removeAttribute() call doesn't work well on IE (nor does textbox.name="").

comment:3 Changed 12 years ago by Douglas Hays

Status: newassigned

comment:4 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

(In [11169]) Fixes #4905. Set JS object name value to "". Problem can be seen with any subclass of MappedTextBox?. Workaround for existing users is to subclass the erring text box class (datetextbox) and to set this.textbox.name="" after calling the superclass postCreate().

comment:5 Changed 12 years ago by bill

Resolution: fixed
Status: closedreopened

I checked on IE6. I bring up the test page, select a date, and then hit go. The address bar changes to:

file:///C:/workspace/dijit/4905.html?=07%2F10%2F18&mydate=2007-10-18

(Haven't tried over http, perhaps there is a difference? Seems doubtful though) Can you take another look?

comment:6 Changed 12 years ago by bill

PS: if you changed the name to mydate_displayed or something like that I wouldn't be too worried (it would still be unfortunate to submit the diplayed value at all), but I'm just worried that web servers will get tripped up by submitting a value with a null name, and also I wonder how a POST request with a null name would look.

comment:7 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: reopenedclosed

(In [11236]) Fixes #4905. For IE, replace the original node so null name values don't get submitted.

comment:8 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: closedreopened

The fix seems to break Filteringselect

comment:9 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: reopenedclosed

(In [11240]) Fixes #4905. Removed node replace code since other node references could have already existed and thus would be invalidated. Just changed the name to "_[oldname]_displayed_"

comment:10 Changed 8 years ago by bill

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