Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

CRM 2013 - Accessing innerHTML of a web resource.

$
0
0

Hi all,

I was wondering what is the best way to edit the string contents(inner html) of a web resources HTML in CRM 2013. We currently have the following code which we used (and worked) for 2011:

function ShowHelpText(fldName, txtLabel)
{
var newHTML = '<SPAN style='COLOR:green;BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px; PADDING-LEFT: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; PADDING-TOP: 0px' id='txt_' + fldName + '' ' +
'>' + txtLabel + '</SPAN>';
var z = Xrm.Page.getControl(fldName).getObject();
z.innerHTML = newHTML;
//Xrm.Page.ui.controls.get(fldName)._control.get_element().childNodes[1].innerHTML = newHTML;
Xrm.Page.getControl(fldName).setVisible(true);
}

The line "z.innerHTML" does not appear to work on its own, however I have had to comment out the bolded line in CRM2013 because I am getting an "error on load - undefined" error. Can anyone tell me what is the support way to change the innerHTML contents of a webresource on CRM2013 or what I may need to change in the above function so that I can pass in the field name and text label contents, then change the innerHTML of the field (web resource) to the txtLabel parameter successfully?

Thanks in advance


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>