• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disable Copy/Paste in a Textbox

 
Nilesh Pat
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

 
Nilesh Pat
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

then write

 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nilesh Pat
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic