Greetings,
Sorry about the question title. It should read:
"Using 'pasteHtml' to capture the value of an external input button"
I found the following code here on site with the associated title:
The following example will show you how to paste content into the editor's content area from an external input button:
-----------------------------------------------------------------------------------------------------------------------------
<telerik:radeditor runat="server" ID="RadEditor1"></telerik:radeditor>
<input type="button" value="Paste Content" onclick="InsertSpan();return false;" />
<script type="text/javascript">
function InsertSpan()
{
var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to the editor
editor.pasteHtml('<span style="width:100px;border: 1px solid red;background-color: blue;color: white;">sample content</span>');
}
</script>
-----------------------------------------------------------------------------------------------------------------------------
Can anybody explain to me how this does _anything_ with a value outside the RadEditor. Seems to me there is a very necessary piece left out of the example. For instance, when using 'OnClientCommandExecuting(editor, args)' to do this kind of thing 'within' the editor, the args parameter is used to produce the value of 'val':
var val = args.get_value();
editor.pasteHtml("<div style='width:100px;background-color:#fafafa;border:1px dashed #aaaaaa;'>" + val + "</div>");
As we can see, the code provided for the external input doesn't come close to addressing how to handle the outside value.
Am I missing something here??
Thanks!
