Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#10970 closed defect (fixed)

form widgets don't escape quotation marks inside name attribute

Reported by: peirix Owned by: bill
Priority: high Milestone: 1.8
Component: Dijit Version: 1.4.2
Keywords: attributes parser quotation Cc:
Blocked By: Blocking:

Description

When using quotation marks inside an attribute, the parser will break the value. And as such, they won't work with forms, as their names are broken.

To reproduce:

<textarea dojoType="dijit.form.SimpleTextarea" name="data.locale['en']">

Will produce this:

<textarea class="dijitTextArea" ]="" en="" name="data.locale[">

There seems to be one way around this, but it's an ugly hack, and not always possible (i.e. when getting attribute values from database), and that is to escape the quotation marks manually like so:

<textarea dojoType="dijit.form.SimpleTextarea" name="data.locale[&#39;en&#39;]">

Change History (7)

comment:1 Changed 9 years ago by peirix

It seems the hack does not work with dojo 1.4.2, but I'm fairly sure I got it to work with dojo 1.4.0

comment:2 Changed 9 years ago by bill

Component: ParserDijit
Milestone: tbd1.5
Status: newassigned
Summary: Parser doesn't escape quotation marks inside attributesform widgets don't escape quotation marks inside name attribute

The parser is working perfectly, you can tell if you check myTextArea.params. The issue is actually in _FormWidget.postMixInProperties which sets up the name to be inserted into the template. I can fix.

comment:3 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [21865]) Allow special characters in name attribute of form widgets, fixes #10970 !strict.

comment:4 Changed 9 years ago by bill

(In [22538]) Escape special characters in name for MappedTextBox widgets. Fixes #10970, #11442.

comment:5 Changed 9 years ago by bill

Milestone: 1.51.6

comment:6 Changed 8 years ago by bill

In [27853]:

Fix quote escaping, thanks Doug, fixes #14784, refs #10970, #11442 !strict.

comment:7 Changed 8 years ago by bill

Milestone: 1.61.8
Note: See TracTickets for help on using tickets.