How to display a HTML field on a form widget

Lisa Silvaroli
Tera Guru

I am trying to get a HTML field to be displayed on a custom version of the Approval Record. 

I have tried the following but cannot seem to get it right:

HTML:

 <div ng-bind-html="::data.u_approval_instruction"></div>

Clint Script:

function($scope, $sce) {
   /* widget controller */
   var c = this;
// Display HTML field
	
$scope.data.u_approval_instruction = $sce.trustAsHtml($scope.data.u_approval_instruction);
}

Server Script:

data.u_approval_instruction = task.u_approval_instructions;

 

I either get the following or nothing at all

find_real_file.png

Any suggestions? 

1 ACCEPTED SOLUTION

Hi,

Can you please post screen shot or more lines where you have added this line in server script?

doing below might fix it

data.u_approval_instruction = task.u_approval_instructions + "";

i added extra  + "" part which will convert it to javascript string.

 

data.u_approval_instruction = task.u_approval_instructions;

View solution in original post

6 REPLIES 6

Bhagyashree8
Kilo Guru

Hi,

Which widget you have customized to add those lines and which version are you on?

try to remove :: (double colon) from below line.

 <div ng-bind-html="data.u_approval_instruction"></div>

also what output are you getting.

 

Please mark Correct/Helpful if it helps.

 

 

I am working with the Approval Record widget. 

Removing the :: still gives me the same result. 

Hi,

Can you please post screen shot or more lines where you have added this line in server script?

doing below might fix it

data.u_approval_instruction = task.u_approval_instructions + "";

i added extra  + "" part which will convert it to javascript string.

 

data.u_approval_instruction = task.u_approval_instructions;

YES! That did it! Thank you very much!!