Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Rich text box content duplication

Avatar

Level 2

Hi Experts

I am trying to get rich text content from one text box to another text box. Here in the below I image i have rich text content in textbox 1 while clicking button the content will be set to text field 2 raw value. It works fine but the formating is missing. I understand this due to scripit variable asigned to text box 2. I ask you experts is there any other way to duplicate textbox 1 content to textbox 2 without loosing the format. Have anyone tried this before.

form.JPG

thanks in advance

1 Reply

Avatar

Level 10

You can do this the following way.

var Source = Textfield1.value.exData.saveXML("pretty");

Textfield2.value.exData.loadXML(Source, true);