New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Attaching blur event handler to RadEditor ContentArea
Updated over 6 months ago
Description
How to attach the blur event listener to the RadEditor's ContentArea
Solution
Depending on the value set for the ContentAreaMode property, there are two different approaches
ContentAreaMode="Iframe"
ASP.NET
<script type="text/javascript">
function InlineEditor_OnClientLoad(editor, args) {
var element = editor.get_contentArea();
$telerik.addExternalHandler(element, "blur", function (e) {
alert("RadEditor loosed focus");
});
}
</script>
<telerik:RadEditor
id="editText"
Runat="server"
ContentAreaMode="Iframe"
OnClientLoad="InlineEditor_OnClientLoad"
>
</telerik:RadEditor>
ContentAreaMode="Div"
ASP.NET
<script type="text/javascript">
function InlineEditor_OnClientLoad(editor, args) {
editor.attachEventHandler("blur", function (e) {
alert("Blur fired");
});
}
</script>
<telerik:RadEditor
id="editText"
Runat="server"
ContentAreaMode="Div"
OnClientLoad="InlineEditor_OnClientLoad"
>
</telerik:RadEditor>