Copying html- to string field encodes characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2016 08:12 AM
I have an HTML description field which I want to strip for html and copy to a pure string field.
I have already dealt with stripping the html tags, but certain characters (not tags) automatically get encoded when copying the value to the string field using a business rule. WHY?
This only occurs when done through a business rule, not when entering special characters directly into the string field.
For example:
Description (HTML) contains characters such as @ og + get encoded when copied without any modification to Symptoms (string) as below:
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2016 08:24 AM
Try this in your client side code
var string= strip(g_form.getValue('description'));
function strip(html)
{
var tmp = document.createElement("DIV");
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || "";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2016 09:02 AM
Thank you for your response.
That does seem to return a well formatted string including the proper characters, but I cannot rely on client side code in this case.
This has to be done in a business rule. Why does this occur?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2019 05:06 AM
I want to capture the html content in a field u_Html_content (type - HTML) of an incident form to the custom table's field (u_description) which is a string field.
I am able to get the data into my custom table's field. But the thing is..... I need to capture the exact format what ever available in incident's field--
I am already capturing its content but its in DIV format, which is not my requirement. I need the exact format
any idea on how to achieve this?