Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:46:42+00:00 2026-06-14T08:46:42+00:00

I am trying to implement an interface, where there is a Rich Text Editor

  • 0

I am trying to implement an interface, where there is a Rich Text Editor (RTE) and a panel on the side which allows the user to introduce certain code snippets into the RTE.

What I am trying is exactly like http://jsfiddle.net/timdown/wPfVn/ only that I want to do it with an RTE instead of a plain textarea.

The problem is that all RTE’s replace the textarea with divs and iframes etc. The textarea functions like selectStart and selectionEnd are not available to detect the cursor position.

Is there an RTE which exposes such functions via an API which I can use?

If anyone has seen something like this on some site, please point me to it. Maybe I can ctrl+u and figure out what they’ve used.

SOLVED:
Thanks to the answer by Magus. One can use TinyMCE editor. It has a concept of selection and selection.bookmarks. Here is how you can achieve the result.

tinyMCE.init({
    mode : "exact",
    elements: "notifierBody",           
});
$('.insertBtn').click(function(){
    // Stores a bookmark of the current selection
    var bm = tinyMCE.activeEditor.selection.getBookmark();
    // Restore the selection bookmark. In effect, takes the control that the bookmark
    tinyMCE.activeEditor.selection.moveToBookmark(bm);
    //Add new content right in the middle where your cursor/selection was
    tinyMCE.activeEditor.selection.setContent('Some new content');  
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:46:43+00:00Added an answer on June 14, 2026 at 8:46 am

    TinyMCE gots some API for the current selection. Look at the documentation : http://www.tinymce.com/wiki.php/API3:class.tinymce.dom.Selection

    A little example :

    tinyMce.activeEditor.selection.getContent({format : 'raw'}); // Get the selected text
    tinyMce.activeEditor.selection.getStart(); // Selection start
    tinyMce.activeEditor.selection.getEnd(); // Selection end
    

    I think many RTE provide this functions. You just have to look the API documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement some interface changes in my app, based on the
I'm trying to implement a REST interface under IIS5.1/ASP-classic (XP-Pro development box). So far,
I am currently trying to implement a marker interface in c#. But I haven't
I'm trying to implement a generic java interface in scala. I have looked at:
I am trying to implement a Stack in java (using the list interface: Interface
I'm trying to design a policy-based class, where a certain interface is implemented by
I'm trying implement A* Start path finding in my games(which are written with JavaScript,
I'm trying to implement a iGoogle like dashboard interface using widgets that get their
I'm trying to implement a plug-in like application. I know there are already several
I'm trying to implement a service contract that contains a method which takes a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.