- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-18-2023 04:44 AM
While Copying HTML field to Journal field using Client Script and removing HTML Tags   is still seen?
// Get the HTML field value
var htmlFieldValue = g_form.getValue('html_field');
// Remove HTML tags using a regular expression
var plainTextContent = htmlFieldValue.replace(/<[^>]*>/g, '');
// Set the plain text content to the Journal field
g_form.setValue('journal_field', plainTextContent);
How to remove   which is still seen after copying?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-18-2023 04:54 AM
Can you try below.
/ Get the HTML field value
var htmlFieldValue = g_form.getValue('html_field');
// Remove HTML tags using a regular expression
var plainTextContent = htmlFieldValue.replace(/<[^>]*>/g, '');
//remove  
var plainTextContentis=plainTextContent.replace(/ /g','');
// Set the plain text content to the Journal field
g_form.setValue('journal_field', plainTextContentis);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-18-2023 06:22 AM
Thank you Jaspal,
After removing HTML Tags and   we recieved ; semicolon which we replaced and then got the Correct Solution with below script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey All,
Can someone help me understand why this does not remove the  ?
// Remove HTML tags using a regular expression
var plainTextContent = htmlFieldValue.replace(/<[^>]*>/g,'');
//remove  
plainTextContent = plainTextContent.replace(/ /g','');
Why do we need to declare a new variable in the second statement? Why aren't we able to simply reuse the first variable and store a new value in it that removes the  ?
Thank you!
