Opened 10 years ago

Closed 10 years ago

#8344 closed defect (fixed)

dojo.attr(node, "readonly", ...) not working in firefox / safari

Reported by: s_i_z_o Owned by: Douglas Hays
Priority: high Milestone: 1.3
Component: Dijit Version: 1.2.3
Keywords: dijit.form.TextBox readonly firefox Cc:
Blocked By: Blocking:

Description

In test page for nightly builds:

http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/Form.html

Read-only widget on the bottom of the page is not really readonly in firefox 2.0.0.20. Value can be changed and is posted on submit. It is working in IE 7.x, didn't check other browsers.

Change History (4)

comment:1 Changed 10 years ago by bill

Owner: set to Douglas Hays
Summary: dijit.form.TextBox readonly not working in firefoxdojo.attr(node, "readonly", ...) not working in firefox / safari

Good catch. It happens in FF3 and safari too. The problem is in dojo.attr(), you can try this in firebug from that page to see:

dojo.attr("dijit_form_DateTextBox_0", "readonly", true)

The problem started in [12332] for #5781. The root issue is that when setting the readonly property via

node.readOnly = true

"readOnly" needs to be in camel case, not lower case. Previously the dojo.attr() code called node.setAttribute(), which is case insensitive, but after [12332] it started assigning the property directly.

I guess fixAttr() should be changed to always convert readonly to readOnly, for all browsers?

comment:3 Changed 10 years ago by bill

Also, Cougar pointed out that this is basically a dup of #7896, except for FF/safari rather than IE8. Anyway, needs to be tested on all browsers.

comment:4 Changed 10 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [16225]) Fixes #8344 !strict. Change readonly to readOnly for all browsers.

Note: See TracTickets for help on using tickets.