javascriptjqueryoracle-databaseplsqloracle-apex-5

Oracle Apex: How can I restrict a numeric field in a form to allow numbers only?


I have an item in a form which is a number field and I want to somehow make sure that only numbers are accepted in the field. If users enter letters I want the field to reject it.

I already tried a validation but it was unsuccessful, is there anyway I get make this happen via a dynamic action with either a javascript code or a "pl/sql code"?


Solution

  • There's absolutely nothing you should do except setting its type to Number field.

    Yes, you can type anything you want into it, but Oracle won't store anything but numbers. It'll raise the "Field name must be numeric" error and stop.

    Why would you want to reinvent the wheel?


    If you must, try with dynamic action on that item (let's call it P13_DEPTNO).