Prevent Copy/Paste on cat item

conanlloyd
Giga Guru

Greetings~

I'm about 95% done with our "Bring Your Own Mobile Device" catalog item and only have 2 customer requirements left that I can't figure out.   Can anyone help me with the following 2 items:

1. We are asking the user to enter their phone's serial number and then again to veryfy no "fat-fingering"   In order to accomplish this I need to prevent pasting into the second field, (names byomb_serial2), and don't know enough javascript to figure it out.

2. I have 2 html fields that contain our acceptable use policy and our terms of service respectively.   Both are listed as read only to prevent editing, but my customer would like to force the user to scroll to the bottom of the html field before they can put their ID in the "signature" block.   Anyone?   Field to be scrolled: byomd_AUP   field to be activated once scroll is complete, byomd_AUP_init

Anyone got this? Mark Stanger? Jim Coyne? This seems the kind of thing you guys excel at.

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

For first question, the below code should work.. Just replace the variable name and add it in any onload script.



var getField = g_form.getControl('is_catalog');


  getField.onpaste = function(e) {


  e.preventDefault();


  };


View solution in original post

2 REPLIES 2

Kalaiarasan Pus
Giga Sage

For first question, the below code should work.. Just replace the variable name and add it in any onload script.



var getField = g_form.getControl('is_catalog');


  getField.onpaste = function(e) {


  e.preventDefault();


  };


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Conan,



You may find the below link helpful.


http://sumtips.com/2011/11/prevent-copy-cut-paste-text-field.html