Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Disabling Ctrl+C and Ctrl+V in a textbox

    Hi,
    I have a textbox in which values should only be typed. User should not be allowed to paste data in the text box. So, on press of Ctrl+V key an error message should be displayed.

    For instance, in Confirm Email id field, user should not be allowed to paste from the Email id field. How can this be done?
    How can this be done?

    Have I made it clear? Would appreciate if u can help me out.



    Thanks,
    Vidya.

  • #2
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,100
    Thanks
    2
    Thanked 23 Times in 23 Posts
    Here is a post from another forum with some pretty good ideas. Hope it helps.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #3
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is not a good idea at all. And destroying this functionality could remove some users from your system. I am talking mostly of the handicaped people that use some other form of writing then a keyboard. There are oftwen shortcut's for their email, name, ect. Not allowing these to be pasted in would be a huge annoyance.

    That and you have to remember that Ctrl-V, while default on windows boxes, is not the only key combination that is used or can be used.
    Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    You are not allowed to change Operating System functionality on your visitor's computer.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #5
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by felgall
    You are not allowed to change Operating System functionality on your visitor's computer.
    Actually you can do a pretty good job of blocking it... that is not a problem... the problem here is accesibility!
    Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •