I have a form in which i have two text boxes one for entering email and the other for verify email (to make sure the user entered the correct email id we are asking to enter the same email id twice),I need to restrict copy feature in both the fields (that is the user should not be able to copy text data from the email and confirm email text boxes) , are there any properties for text box using which i can do this or should i try using java script,I tried using some key press functions but it din work , can u suggest me some method in which this can be achieved.
I want it to work in both IE and Mozilla
I tried certain stuff which works in ie but not in mozilla .
can some one help??
1.[HTML]<body ondragstart="return false" onselectstart="return false">[/HTML]
2.
Expand|Select|Wrap|Line Numbers
- function preventCopyPaste() {
- var key = String.fromCharCode(event.keyCode).toLowerCase();
- if ((event.ctrlKey && (key == "c" || key == "v")) ||
- (event.shiftKey && event.keyCode==45)) {
- event.returnValue = false;
- }
- }
- function preventRightClick(){
- var rightClick=false;
- if(event.which) rightClick=(event.which==3);
- if(event.button) rightClick=(event.button==2);
- if(rightClick) alert("Right click restricted");
- }
Thanks ,
Albin.