Re: [Xsltforms-support] Force checkbox readonly
Brought to you by:
alain-couthures
From: Alain C. <ala...@ag...> - 2012-10-03 19:44:26
|
Hello Javier, I have committed this patch without a test case to valid it. Thank you for your feedbacks! -Alain Le 03/09/2012 13:34, Javier Díaz a écrit : > Hello, > > We are trying to set a checkbox readonly but it only gets shadowed, but > it can still be checked. > > We have done this change in javascript: > > XsltForms_input.prototype.changeReadonly = function() { > + var node = this.element.node; > + var type = node ? > XsltForms_schema.getType(XsltForms_browser.getType(node) || > "xsd_:string") : XsltForms_schema.getType("xsd_:string"); > + > if (this.input) { > + if (type["class"] === "boolean") { > + this.input.disabled = this.readonly; > + } > + > this.input.readOnly = this.readonly; > if (this.calendarButton) { > this.calendarButton.style.display = > this.readonly ? "none" : ""; > > > So the checkbox is readonly, althought it isn't sent when submit (it > isn't a problem for me). > > ¿Do you know a better way of forcing it? > > |