Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi all

I have to check 2 email id's are same or not..on the second text-box i have stop user to copy-paste the id from the first textbox.please tell me what property i have to set for the textbox to prevent it from copy-pasting
Posted
Comments
Sergey Alexandrovich Kryukov 13-Aug-12 1:26am    
Why would you ever need it?
--SA
[no name] 13-Aug-12 1:28am    
i need the user to type and confirm ... i don't need copy-paste from the first value..
Sergey Alexandrovich Kryukov 13-Aug-12 1:34am    
You don't need, and the user is not allowed -- are different things. I'm not asking you about what you don't need. Why would you ever need restricting the user?
--SA

1 solution

You need to set oncopy and onpaste property of your TextBox to false.
HTML
<input type="text" name="txtEmail" oncopy="return false"  onpaste="return false" />


Best of luck.
 
Share this answer
 
v3
Comments
[no name] 13-Aug-12 3:17am    
it worked.. thank u...
Raje_ 13-Aug-12 3:23am    
Welcome.
Sergey Alexandrovich Kryukov 13-Aug-12 13:19pm    
My 5. I actually did not know about it, thought it was impossible. Do you know about browser compatibility of this feature?
I still do not recommend using it.

Thank you.
--SA
Raje_ 13-Aug-12 13:37pm    
Thank you Sir, I have tested this example on the following browsers – IE (versions 7 & 8), Firefox , Chrome, Safari. It works fine.
Sergey Alexandrovich Kryukov 13-Aug-12 14:02pm    
Good to know; thank you for sharing...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900