This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Disable Copy/Paste in a Textbox

 
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

 
Bartender
Posts: 11445
18
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • 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
Boost this thread!