Re: [Xsltforms-support] bind/@readonly turns into HTML4 @disabled=""instead of @readonly="readonly"
Brought to you by:
alain-couthures
From: Klotz, L. <Lei...@xe...> - 2010-04-29 23:54:08
|
Oops on the XHTML-specified value; I see now it's done in the JS and not the XSLT. I tried this in FF3.5. Note "readOnly" instead of "readonly". XFInput.prototype.changeReadonly = function() { if (this.input) { - this.input.disabled = this.readonly; + this.input.readOnly = this.readonly; if (this.calendarButton) { this.calendarButton.style.display = this.readonly? "none" : ""; } } }; XFSelect.prototype.changeReadonly = function() { if (this.full) { var list = Core.isXhtml ? this.element.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "input") : this.element.getElementsByTagName("input"); for (var i = 0, len = list.length; i < len; i++) { - list[i].disabled = this.readonly; + list[i].readOnly = this.readonly; } } else { if (!Dialog.knownSelect(this.select)) { - this.select.disabled = this.readonly; + this.select.readOnly = this.readonly; } } }; Leigh. -----Original Message----- From: Klotz, Leigh [mailto:Lei...@xe...] Sent: Thursday, April 29, 2010 4:20 PM To: support xsltforms Subject: [Xsltforms-support] bind/@readonly turns into HTML4 @disabled=""instead of @readonly="readonly" If you do bind textarea to a readonly input field, it transforms into <... disabled="">... You cannot then select and copy the text. I believe it should use readonly instead of disabled, and also use the XHTML-specified value for the attribute: ...readonly="readonly">... <?xml version="1.0"?> <?xml-stylesheet href="//xsltforms/xsltforms.xsl" type="text/xsl"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <head> <model xmlns="http://www.w3.org/2002/xforms"> <instance> <data xmlns=""> <test1>abc def</test1> <test2>abc def</test2> </data> </instance> <bind nodeset="test1" readonly="true()" /> <bind nodeset="test2" relevant="false()" /> </model> </head> <body> <h1>Test</h1> <group xmlns="http://www.w3.org/2002/xforms"> <textarea ref="test1"> <label>Readonly Test</label> </textarea> <textarea ref="test2"> <label>Relevant Test</label> </textarea> </group> </body> </html> ------------------------------------------------------------------------------ _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support |