File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes GWT and the fly likes Disable Copy/Paste in a Textbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "Disable Copy/Paste in a Textbox" Watch "Disable Copy/Paste in a Textbox" New topic
Author

Disable Copy/Paste in a Textbox

Nilesh Pat
Ranch Hand

Joined: Mar 01, 2010
Posts: 46

i want to Disable Copy/Paste in a Textbox in GWT.
as i am using password field and confirm password filed. User should not able to copy string from password filed to confirm password filed.

i am using PasswordTextBox for password filed.

i also want to do same for user id n confirm user id which are normal text boxes.


Regards,
Nil
Nilesh Pat
Ranch Hand

Joined: Mar 01, 2010
Posts: 46
hey... password text box itself provides functionality to block copy from it.
but you can paste in it... so that's ok.

but the problem exists for normal text box. at least i should able to block paste in confirm text box.
Nilesh Pat
Ranch Hand

Joined: Mar 01, 2010
Posts: 46

hey i got the solution.
first write
sinkEvents( Event.ONPASTE );
in the constructor.

then write

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10266
    
    8

Well done
Thank you for sharing your solution.

PS. I edited your previous post to incorporate code tags. In future, while posting code, please UseCodeTags As you can see, code tags makes the post easier to read and easier to understand.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Nilesh Pat
Ranch Hand

Joined: Mar 01, 2010
Posts: 46
hey maneesh thank you..

actually i was also searching for that UseCodeTags but could't find it. so just posed it..
but thank you for your editing.
 
 
subject: Disable Copy/Paste in a Textbox