2

I have a multi-line Text field on a form CRM 2011 with update rollup 17. I have enabled the readonly property field with the following code:

Xrm.Page.ui.controls.get('description').setDisabled(false);

It works correctly in Internet Explorer but not in any other browsers. What's the problem?

Scorpion
  • 4,495
  • 7
  • 39
  • 60
Mary1987
  • 19
  • 1

2 Answers2

1

It should work in other browsers as well as far as they are supporting CRM application. You should debug the Javascript in the browser that you are having issues in. Press F12 and in the console press start debugging when you load the page. It will give show you the errors in javascript and show you whether your javascript is even being loaded in the browser or not. Alternatively try Xrm.Page.getControl('description').setDisabled(false)

hkhan
  • 843
  • 2
  • 19
  • 45
  • in customization form , i have made all input elements as read only (include type text, multiline text and ... ) when loading the form, i'm using javascript code to enabling all field and works in IE,but not in other browser, and the problen is in other browsers, all inputs are enabled exccept of multi line text field – Mary1987 Jul 22 '14 at 11:03
  • i have changed code,Xrm.Page.getControl('description').setDisabled(true), it works correctly,but Xrm.Page.getControl('description').setDisabled(false) not worked :( – Mary1987 Jul 23 '14 at 04:25
  • Have you debugged it in the other browser as I asked? Put a break point at this line debug it in the browser by pressing F12 – hkhan Jul 23 '14 at 08:00
  • i have pressed F12, show WORNING : 'Attr.textContent' is deprecated. Please use 'value' instead. global.ashx?ver=1793104097:6 – Mary1987 Jul 23 '14 at 09:49
  • This happens on simply pressing F12? The error means that the DOM of the browser cannot find Attribute TextContent which has been deprecated, in other words not available. which browser are you using btw? – hkhan Jul 23 '14 at 11:16
  • yes. this happens on pressig F12 in chrome Browser, and in Firefox : Use of document.createAttribute() is deprecated. Use element.setAttribute() instead. – Mary1987 Jul 23 '14 at 12:03
  • NO bug in form but only 1 warning – Mary1987 Jul 23 '14 at 12:06
1

You can also write the following statement :

var description = document.getElementById("description");
if (description != null)
{
    description.disabled=false;
}
Chirag
  • 324
  • 2
  • 4
  • 27