Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to trigger java script on text field on copy/cut/paste?

User_AO9J8May 31 2018 — edited Jun 12 2018

How to trigger java script on text field on copy/cut/paste?

I want to trigger disableCopy, disablePaste and disableCut on a text field on oracle forms.

The java script is as below

function gtDate()

{

var currentTime = new Date()

var month = currentTime.getMonth() + 1

var day = currentTime.getDate()

var year = currentTime.getFullYear()

return day + "/" + month + "/" + year

}

function setVal(fieldval)

{

document.getElementById("field1").value=fieldval;

}

function getVal()

{

return document.getElementById("field1").value;

}

function selfClose()

{

document.myapplet.raiseEvent('close', 'anything');

}

function disableCopy()

{

alert("You cannot perform Copy");

return false;

}

function disablePaste()

{

alert("You cannot perform Paste");

return false;

}

function disableCut()

{

alert("You cannot perform Cut");

return false;

}

function disableContextMenu()

{

alert("You cannot perform right click via mouse as well as keyboard");

return false;

}

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2018
Added on May 31 2018
4 comments
375 views