This is a migrated thread and some comments may be shown as answers.

Couldn't find how to get access to pure RadEditor content during spell checking

2 Answers 36 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Volodymyr Tatarin
Top achievements
Rank 1
Volodymyr Tatarin asked on 27 Jul 2010, 04:35 PM
Hello,

  I have following task:
- there is RadEditor with spell checker tool
- any changes in RadEditor fire event to update some div element (on the page) with content of RadEditor
- when I put incorrect words into the RadEditor and click on Spell Check the content of the RadEditor contains not only formatted text, but also <span> tags with id = "RadESpellError_*" & class "RadEWrongWord"
  As result I copy the content into my div element and when moving via spell checking, the checker moves to my div and work with my copied words (because they contains the same IDs and class as the spell checker inserted)

  Could you please help me with get pure content from the Editor to copy into my div w/o impact from Spell Checker side then?

Thanks a lot!

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 28 Jul 2010, 08:35 AM
Hi Volodymyr,

The get_html method returns the current content in the content area of RadEditor. If you want to get the clean editor's content without any special tags that RadSpell inserts to highlight the misspelled words, you should stop the spellchecking process and after that execute the get_html method. Here is an example:


<telerik:RadEditor runat="server" ID="RadEditor1"></telerik:RadEditor>
<input type="button"  value="Get Content" onclick="GetContent();return false;"  />
<script type="text/javascript">
    function GetContent() {
        var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to the editor
        var spell = editor.get_ajaxSpellCheck();
        spell.cancelSpellCheck();
        alert(editor.get_html(true));
    }
</script>

This is the only way to get the content without obtaining the special tags and formatting of the highlighted by RadSpell misspelled words.

Best wishes,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Volodymyr Tatarin
Top achievements
Rank 1
answered on 29 Jul 2010, 09:58 AM
Thanks a lot for the answer! I've blocked copying during spellchecking and it works for me.
Tags
Editor
Asked by
Volodymyr Tatarin
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Volodymyr Tatarin
Top achievements
Rank 1
Share this question
or