Frage

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.

War es hilfreich?

Lösung 2

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.

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top