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

Use tool bar button to insert tags at beginning and end of selected text

1 Answer 26 Views
Editor
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 16 Aug 2010, 09:59 PM
On a custom toolbar button click I would like to insert a start html tag at begining of  selected content and and an close tag at the end of the selection.

There is a help on inserting HTML tag at the beginning of the selection, the problem is inserted the close tag at the end of the selection

for example a user selcts some text in content area;
Telerik.Web.UI.Editor.CommandList["MyTestButton"] = function(commandName, editor, args)
{
   editor.pasteHtml(
'<TagBegin>');

       /*some way to find end of selection ???*/

   editor.pastHtml('<TagEnd>');
 
};

Thanks in advanced

-----addendum-----
---Never mind... This is clearly addressed in the help---

http://www.telerik.com/help/aspnet-ajax/obtainingcurrenteditorselectionashtml.html

1 Answer, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 17 Aug 2010, 03:24 PM
Tags
Editor
Asked by
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Share this question
or