views:

1217

answers:

4

We use Telerik's RadEditor for our content management system's WYSIWYG editor. We need the find & replace functionality that is in the WYSIWYG editor to also be in the HTML editor. The editor is pretty customizable, anyone know if there is a way to enable this or hack it in?

A: 

There is an example on their demo site for RadEditor ASP.NET Ajax.

Just click on the 3rd button of the toolbar in order to test "Find and Replace".

Take a look at this example page too.

It defines this toolbar

...  
<telerik:EditorSeparator />
<telerik:editortool name="FindAndReplace" />
<telerik:editortool name="TableWizard" />
<telerik:editortool name="LinkManager" />
<telerik:editortool name="PageProperties" />
<telerik:EditorSeparator />
...
splattne
Jim
A: 

There is no built-in functionality for what you are looking for. But using the clientside API and some javascript you could hook up your own button that does a find and replace using the editor.get_html() and editor.set_html() functions. You could then consider using some RegEx or just a simple javascript .replace() to do your find and replace?

You can find the RadEditor documentation on the Telerik site.

Sean Molam
A: 

When the editor is in HTML mode, the content area is a simple < textarea > element. I think by design, all tools on the editor toolbar are disabled in HTML mode, so you will need to write some custom JavaScript code to implement the find and replace. You can get a reference to the textbox with *editor.get_textArea()*. From there it becomes difficult, because I think that searching for text in a textarea is only supported in IE (selection.findText).

lingvomir
A: 

Hi,

Since Q2 2010, the Find and Replace button is enabled in HTML mode of RadEditor in Internet Explorer. This feature is still not supported in Firefox, due to browser limitations.

http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx