Saturday, 15 October 2016

Disabling copy paste on an input field

We have Email address and Confirm Email Address fields on the page  and we want that  
the user should not be permitted to copy and paste from the first field to the second, they should retype their email address.

1) Place the two input fields on the page and connect them to the records you wish to save to, as usual.

2) Place an HTML Area on the page, making sure it should be placed after / beneath all the fields available on the page   



3) Make the HTML Area contents static, and paste in the following: 

 Record.fieldname  =  IOBM_A_BIO_INFO.IOBM_A_CNFRM_EMAIL   in javascript  dot will replace with underscore .


 <SCRIPT language=JavaScript>
var message = "Paste disabled. Please re-key.";

function disablepaste(){


return false;
}

document.getElementById('IOBM_A_BIO_INFO_IOBM_A_CNFRM_EMAIL').onpaste=disablepaste;
</SCRIPT>


 

No comments:

Post a Comment