473,396 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Prevent right click paste in Rich Text Editor

arnabc
6
Hi all,

I am developing one online forum kind of website where users have the facility to submit there comments and to do that we r using one custom made rich text editor. So far it was fine but suddenly I discovered that one can paste a large amount of text or a Big Image in the Rich text editor which was not a desired thing because we set up a maximum limit of text one can enter and the Big image problem is that we have the option to insert smileys so distinguishing the pasted image from the smileys is a problem. So then to prevent this we tried to disable the "ctrl + v" function using key code checking in JavaScript it was working fine but I am not able to prevent it if in case anyone right clicks in that editor and selects "paste" from there. Do you guys have any suggestion regarding this or any useful commment which can help me to find a workable solution. Thanks in advance.
Jul 3 '07 #1
2 2846
acoder
16,027 Expert Mod 8TB
Instead of trying to prevent right-click, just check for the length of the text input when submitting the form or when a key is pressed. If someone disables Javascript, you won't be able to prevent them right-clicking. Javascript checking is useful, but you should never depend on it - always make a check on the server-side too.
Jul 3 '07 #2
arnabc
6
Instead of trying to prevent right-click, just check for the length of the text input when submitting the form or when a key is pressed. If someone disables Javascript, you won't be able to prevent them right-clicking. Javascript checking is useful, but you should never depend on it - always make a check on the server-side too.

Ya I am checking the length of the text in keypress but for right click "paste" the keypress event doesn't fire and that's the problem. I also have server side checking for text length which is working fine chopping extra inputs but the main problem is with the IMAGE as I am unable to determine whether it's a smiley or a pasted image that's why I was trying to prevent pasting operation in RTE, just to stop pasting Images into the editor. Anyway thanks for your reply.
Jul 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Alpenvrouwtje | last post by:
Hallo, Does anyone have a (simple?) javascript code for me to prevent that people take the photo's of my website while they use the right mouse button. I know that there are ways around this...
5
by: Add and Paste | last post by:
Dear Access developers, I have a lot of cut and pasting to do from Excel to an Access form. But instead of just pasting, I want to "add then paste" the value. Does anybody have a way to do this?...
8
by: EEEdiot | last post by:
Does anyone know of a good rich text editor web control for ASP.NET that is *free*? TIA.
4
by: Paddy | last post by:
Hi, Is their a colourized editor/shell that allows you to cut and paste the colourized text? Idle, SPE, Eclipse, and pythonwin all seem to nicely colourize both command line input as well as...
11
by: RobKinney1 | last post by:
Hello, I am looking for a clever way to prevent someone from pasting copied text outside of my app. I know how to monitor the clipboard and get an WM_DRAWCLIPBOARD message when text is stored...
4
by: pbreah | last post by:
I'm doing a Rich Text Editor (WYSIWYG) in javascript for a game for kids. I'm doing a special case in with every keystroke from A-Z creates a background and foreground color for that letter, witch...
2
by: AjitGoel | last post by:
Hi; I need to create a custom textbox control which will not allow a user to paste text from the clipboard. The user has to always type the text into the textbox. I tried searching on the...
2
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005, .net 2 for a windows application. I have a richtextbox control on my form that I make it readonly. 1. Do I need to make readonly to be false to append text to it? 2. Even...
3
by: GarryJones | last post by:
I found this handy little script on the net that means the user can only press backspace or numbers in form input. <script type="text/javascript"> function numbersonly(e){ var...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.