4 Answers, 1 is accepted
To clean the editor content on the client-side you need to get a reference to the editor and call its set_html method, e.g.
var editor = $find("<%=RadEditor1.ClientID%>");
editor.set_html("");
Best regards,
Tervel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
<asp:Button ID="SaveDiaryEntry2" runat="server" Text="Spara allt permanent" OnClick="SaveDiaryEntry_Click"
SkinID="MemberButton" UseSubmitBehavior="true" ValidationGroup="Entry" OnClientClick="ClearEditor" />
<cc1:ConfirmButtonExtender ID="SaveDiaryEntry2_ConfirmButtonExtender" runat="server"
ConfirmOnFormSubmit="True" ConfirmText="Spara din dagboksanteckning? När anteckningen sparas kan den inte längre ändras..."
Enabled="True" TargetControlID="SaveDiaryEntry2">
</cc1:ConfirmButtonExtender>
My ClearEditor Function is located near the top of a ContentPage:
<script type="text/javascript">
function ClearEditor() {
var editor = $find("<%=RadEditor1.ClientID%>");
editor.set_html(
"");
}
</script>
just after the ScriptManagerProxy. Any thoughts?
Before we delve any further, I would suggest adding a simple alert('hello') statement before the editor reference, just to make sure your code gets properly called.
Best wishes,
Tervel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I have now tried this approach and the alert never shows so the client-side function is not executed. It seems this function needs to be called when the OK button in the ConfirmButtonExtender is pressed.