Hi I'm using pasteHTML event on radeditor to paste new content on cursor position, if the editor box is empty it works just great, but if there something else and I hit enter it will modify my html making it useless
Here is my script:
function Add_Accordion() {
var Edtr = $find("<%=ContentEditor.ClientID%>");
Edtr.pasteHtml("<div id=\"accordion\"><h2>Section 1 title</h2><div><p>Text 1</p></div><h2>Section 2 title</h2><div><p>Text 2</p></div></div>");
}
So.. if I add Hello world! on the first line of editor, hit enter and then click the button to add the script above, this is the resulting html...it add tags and duplicates the ids
<div id="accordion">
</div>
<p>Hello world</p>
<div id="accordion">
<h2>Section 1 title</h2>
<div> </div>
</div>
<p>Text 1</p>
<div id="accordion">
<div> </div>
<h2>Section 2 title</h2>
<div> </div>
</div>
<p>Text 2</p>
Thanks for your help!