HTML Richtext field
Posted: 26 Oct 2015
Hi
See A to C below.
I mangage to write RichText from a object (obj.street below) to a list field of type "Rich text" - se A .
In a HTML section with custom javascript I also manage to write plain text to a <p id="demo3"></p> in the Body see B.
But I cant manage to write Rich text in to a field in my HTML body (it returns ony plain text) - see C. , have tried with
<p id="demotest"></p> and
<textarea id="demotest" rows="3" cols="20">
Enter text here...
</textarea>
But neither works - what is the correct tag ? / suggestions?
Code:
A
fd.field('Body').control()._el()
.find('.ms-rtelong').contents().find('body').html(obj.street);
B
var x1 = document.getElementById("Name");
x1.value=obj.name;
C
var x8=document.getElementById("demotest");
x8.value=obj.street;
See A to C below.
I mangage to write RichText from a object (obj.street below) to a list field of type "Rich text" - se A .
In a HTML section with custom javascript I also manage to write plain text to a <p id="demo3"></p> in the Body see B.
But I cant manage to write Rich text in to a field in my HTML body (it returns ony plain text) - see C. , have tried with
<p id="demotest"></p> and
<textarea id="demotest" rows="3" cols="20">
Enter text here...
</textarea>
But neither works - what is the correct tag ? / suggestions?
Code:
A
fd.field('Body').control()._el()
.find('.ms-rtelong').contents().find('body').html(obj.street);
B
var x1 = document.getElementById("Name");
x1.value=obj.name;
C
var x8=document.getElementById("demotest");
x8.value=obj.street;