Prevent pasting into custom textbox control.

Discussion in 'ASP .Net' started by AjitGoel, Apr 17, 2007.

  1. AjitGoel

    AjitGoel Guest

    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 internet since I guessed someone would have
    faced this problem before but of no avail. Do we have pointers on how
    I should go about doing this??

    Comments\suggestions are highly appreciated.

    Kind Regards;

    Ajit Goel
     
    AjitGoel, Apr 17, 2007
    #1
    1. Advertising

  2. AjitGoel

    Ray Costanzo Guest

    I can't imagine why you'd want to do this, and it's pretty much not possible
    to prevent someone completely from entering data into a textbox the way he
    seems fit. In addition to pasting, will you try to prevent the person from
    dragging text in? If you capture Ctrl+V with javascript, will you also
    capture keyboard buttons that paste without just "sendkey'ing" Ctrl+V? What
    about when someone uses something like Roboform to fill the field? Will you
    also prevent a right-click so the person can't choose to paste from the
    context menu?

    I suggest that you eliminate this requirement if at all possible. To put
    together a perfect solution is impossible. To put together one that is
    close to perfect would be a lot of code to maintain for something very
    silly.

    Ray at work

    "AjitGoel" <> wrote in message
    news:...
    > 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 internet since I guessed someone would have
    > faced this problem before but of no avail. Do we have pointers on how
    > I should go about doing this??
    >
    > Comments\suggestions are highly appreciated.
    >
    > Kind Regards;
    >
    > Ajit Goel
    >
     
    Ray Costanzo, Apr 17, 2007
    #2
    1. Advertising

  3. AjitGoel

    AjitGoel Guest

    Thanks Ray;

    I appreciate your input. I guess this thought came in when the BA and
    my director told me to explore this option.

    On Apr 17, 1:52 pm, "Ray Costanzo" <my first name at lane 34 dot
    commercial> wrote:
    > I can't imagine why you'd want to do this, and it's pretty much not possible
    > to prevent someone completely from entering data into a textbox the way he
    > seems fit. In addition to pasting, will you try to prevent the person from
    > dragging text in? If you capture Ctrl+V with javascript, will you also
    > capture keyboard buttons that paste without just "sendkey'ing" Ctrl+V? What
    > about when someone uses something like Roboform to fill the field? Will you
    > also prevent a right-click so the person can't choose to paste from the
    > context menu?
    >
    > I suggest that you eliminate this requirement if at all possible. To put
    > together a perfect solution is impossible. To put together one that is
    > close to perfect would be a lot of code to maintain for something very
    > silly.
    >
    > Ray at work
    >
    > "AjitGoel" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > 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 internet since I guessed someone would have
    > > faced this problem before but of no avail. Do we have pointers on how
    > > I should go about doing this??

    >
    > > Comments\suggestions are highly appreciated.

    >
    > > Kind Regards;

    >
    > > Ajit Goel- Hide quoted text -

    >
    > - Show quoted text -
     
    AjitGoel, Apr 17, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Z2FuZXNoX2luZm9zeXM=?=

    pasting xml data into an excel template

    =?Utf-8?B?Z2FuZXNoX2luZm9zeXM=?=, Aug 24, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    677
  2. Anguel Stankov

    Pasting a file into a Java String

    Anguel Stankov, May 11, 2004, in forum: Java
    Replies:
    16
    Views:
    777
    Roedy Green
    May 14, 2004
  3. Marc Van Laer
    Replies:
    0
    Views:
    423
    Marc Van Laer
    Apr 11, 2005
  4. Wladimir Borsov
    Replies:
    0
    Views:
    372
    Wladimir Borsov
    Aug 28, 2003
  5. Replies:
    16
    Views:
    178
    Dr John Stockton
    Sep 15, 2006
Loading...

Share This Page