user1608982
user1608982

Reputation:

Jquery function not working with HtmlEditorExtender

I have a textbox with HtmlEditorExtender and on click of an a-href, there's a jquery function that should append text in the textbox.

THe function works fine with a normal textbox, but not with the one that has a HtmlEditorExtender.

Any ideas?

Thnx in advance.

Upvotes: 1

Views: 572

Answers (2)

user1608982
user1608982

Reputation:

I managed to set the text of the TextBox this way:

document.getElementById('editor_HtmlEditorExtender_ExtenderContentEditable').innerHTML = "asdf";

where editor is the id of the TextBox.

Upvotes: 1

strongBAD
strongBAD

Reputation: 331

To get access to control instance on the client, you use the control property on the DOM element it self as follows:

<script type="text/javascript"> //considering the editor is loaded.

var editorControl = $get("<%=editor.ClientID%>").control; 

//1. For setting content: 

editorContorl.set_content("Sample Content"); 

//2. For getting content:

var content = editorContorl.get_content(); 

</script>

take care, M

Upvotes: 1

Related Questions