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

PDF to Text Covert by Oracle Apex

Here are the steps to convert and get the character into a region by Oracle Apex. Step1.  Create a page and Copy-Pest the below code into Pa...