Copying the html content in the HTML field type to String field

mazin690
Tera Contributor

Hi,

I have scenario, like Copying the Html content in the HTML field type to String field

what ever format that was ter in HTML field..same as to replicate in Plain text(string field) as well.Without changing the format,

any Idea on it. can anybody help me on this.

 

1 REPLY 1

prasannaposetty
Tera Expert

var htmlStr = current.html_field.getDisplayValue(); (Your HTML field value)

var txtStr = htmlStr.replace(/<(?:.|\n)*?>/gm, '');

gs.print(txtStr);