Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

RTE editor

Avatar

Level 3

Hi All,

Good Morning....

I created one rte plugin and incorporated on RTE(rich text) dialog,am able to add data in RTE using my rte plugin but displaying it is removing href from the anchor tag.

Stpep:

Once select the 'Chat icon Links'  from the dialog,it is opening textbox and entering the "Chat Now" value.

I see the value in RTE editor "<a href="javascript:void();">Chat Now</a> througn firebug but while selecting 'OK' button from the main dialog it is displaying data

"Chat Now" but it is not contain hfef attribute.i see the below value through firebug :

<a>Chat Now</a>.

 

How to restrict not to change data from the RTE editor?

Can you please suggest me or share me any code snippet?

Thanks in advance.

 

Thanks,

Venkatesham G

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi

A simple suggestion I can give from side to achieve what you want. When you add <a>Chat Now</a> in RTE, If you can an id attribute, lets day like 

<a id="myChatLink">Chat Now</a>, once it is rendered on webpage,  using JS you can add href

x = document.getElementById("myChatLink");

x.addAttribute("href", "javascript:void()");

Thanks

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Hi

A simple suggestion I can give from side to achieve what you want. When you add <a>Chat Now</a> in RTE, If you can an id attribute, lets day like 

<a id="myChatLink">Chat Now</a>, once it is rendered on webpage,  using JS you can add href

x = document.getElementById("myChatLink");

x.addAttribute("href", "javascript:void()");

Thanks