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 9156943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:53:31+00:00 2026-06-17T12:53:31+00:00

Referring to the answer here: How to use TinyMCE functions on text without actually

  • 0

Referring to the answer here:
How to use TinyMCE functions on text without actually selecting that text?

I’ve realized that

$('#TAID_ifr').contents().find('html').bind('keypress', function(e){return false;});

doesn’t work for the enter key. When a user hits “enter”, a newline is formed. But for all other keys, the code works as expected, i.e. nothing happens. Does enter require some special treatment? I added the code below but it didn’t make a difference:

            var code = e.keyCode || e.which;
                if (code == 13) e.preventDefault();

What’s wrong? I don’t want a new line to be inserted when a user hits “enter”, I want nothing to happen.

Edit

Does this not work because the enter key is pressed inside an iframe?

  • 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-17T12:53:33+00:00Added an answer on June 17, 2026 at 12:53 pm

    Yes, this is possible. Tinymce uses its own event management.
    There is a tinymce event called onKeyDown. Using the setup configuration parameter you may use this event:

    // Adds an observer to the onKeyDown event using tinyMCE.init
    tinyMCE.init({
       ...
       setup : function(ed) {
          ed.onKeyDown.add(function(ed, event) {
    
              if (event.keyCode == 13)  {
                  event.preventDefault();
                  event.stopPropagation();
                  return false;
              }
          });
       }
    });
    

    Be aware that several statements are used here to stop the propagation of code due to the fact that the implementation in different browsers differs.

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

Sidebar

Related Questions

Referring to the first answer about python's bound and unbound methods here, I have
Referring to this question, no solution/answer was given for Oracle platform. Selecting Nth Record
Referring to the answer by Jon Skeet here: Pass An Instantiated System.Type as a
MySQL noob here; looked around first but couldn't find the answer to this question.
I have managed to use the answer here to rotate the camera preview to
I'm referring to an answer here: Why can't I get ViewScope to work? Throws
Referring second answer to question: How to convert from ASCII to Hex and vice
I've asked a similar question before here and the answer solved my problem. However,
If the answer is yes, can you tell me why? here is an example:
I'm afraid I already know the answer, but I'm hoping that somebody can provide

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.