• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Disable Copy/Paste in a Textbox

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

then write

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic