Search This Blog

Thursday, March 19, 2020

Character Restrict From a Item and Only Numeric Will Allowed

1. Copy The Below Code to Page Function and Global Variable Declaration. 
function validateNumber(event) {
  var keyCode = event.keyCode;
  var excludedKeys = [8, 37, 39, 46];

  if (!((keyCode >= 48 && keyCode <= 57) ||
      (keyCode >= 96 && keyCode <= 105) ||
      (excludedKeys.includes(keyCode)))) {
    console.log("alphabets are not allowed");
    event.preventDefault();

  }

  console.log("keycode: " + keyCode);
}
2.  And Copy the below function Calling on Item Custom Attribute.
onkeydown="return validateNumber(event)";  


No comments:

Post a Comment

Restrict File Upload by File Type in Oracle Apex

If you want to restrict file upload by file type/extension/format you can follow the below steps.  Goto File Browser Item --> Advanced --...