8837

How can I prevent tinyMCE's paste event?

I need to prevent the paste event of tinyMCE if the length of the current content of editor plus the length of the words to be pasted exceed the specified limit. How can I do it? Thank you.

Answer1:

I was wrong. I dont need to prevent or disable paste in tinyMCE to do this. I used their <strong>paste</strong> plugin and modified the content before it is pasted.

function(pl, o) { ... if(len > limit) { o.content = ''; } }

Answer2:

I think it's better to use the paste_preprocess function.

It's a old question, but others may stumble on this problem.

Recommend

  • Trying to iterate over the frames in a System.Drawing.Image, throws invalid parameter exception
  • Why is my float being truncated?
  • Blank screen using DrawImage method
  • How can I force an AngluarJS form to realize required fields have been filled through DOM manipulati
  • (Responsive)Table Width does not fit the container inside iframe on ios safari
  • How do I embed a custom user-control in MS Word?
  • How to share a database between ASP.NET MVC 5 application and .NET console application?
  • gulp.watch running same task multiple times when saving many files
  • help('modules') crashing? Not sure how to fix
  • CKeditor stripping font tags instead of converting to span
  • Certain Arabic text gets incorrectly shown while other Arabic text gets showed normally?
  • How can I add div content to a new page in jspdf?
  • Can XOR be expressed using SKI combinators?
  • Emacs lua-mode issue: (void-function interactively-called-p)
  • Want to understand iframe breakout code
  • Changing media screen makes div overlay
  • event.getSource() returns null Accessibility in android
  • Consuming a WCF service in a Java Client using wsHttpBinding
  • Bash if statement with multiple conditions
  • Run multiple queries from 1 SQL file showing result in multiple tables
  • Tamper-proof configuration files in .NET?
  • Xcode 4 NSLog Macro link in Xcode 3
  • d3 v4 drag and drop with TypeScript
  • JQuery Internet Explorer and ajaxstop
  • Using $this when not in object context
  • Opengl-es onTouchEvents problem or a draw problem? [closed]
  • DotNetZip - Calculate final zip size before calling Save(stream)
  • How to limit post in wp_query
  • Delete MySQLi record without showing the id in the URL
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • Invalid access key error using credentials redeemed from an amazon open id token
  • PHP: When would you need the self:: keyword?
  • Load html files in TinyMce
  • Acquiring multiple attributes from .xml file in c#
  • Free memory of cv::Mat loaded using FileStorage API
  • Hits per day in Google Big Query
  • Linking SubReports Without LinkChild/LinkMaster
  • Does armcc optimizes non-volatile variables with -O0?
  • reshape alternating columns in less time and using less memory
  • How can I use threading to 'tick' a timer to be accessed by other threads?