Oracle Application Express (MOSC)

MOSC Banner

Check if value entered in page item or IG-column is a number with a Client-Side Javascript Expressio

edited Jan 8, 2019 11:53AM in Oracle Application Express (MOSC) 2 comments

The idea is to be able to check to see if the value entered into a field is a number or not. It's a javascript function that can be used inside a client-side javascript expression for a dynamic action for a page item or IG column.

In this example I will use the javascript function to check to see if the value keyed down inside an interactive grid cell is a number.

Place this in the Page => Function and Global Variable Declaration =>

function isNumber(n) {

  return !isNaN(parseFloat(n)) && isFinite(n);

}

Then create a dynamic action on the IG column (in my case a 'Number Field' IG column type):

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center