1 Reply Latest reply: Feb 8, 2013 3:57 AM by Denes Kubicek RSS

    Number field validation

    DejanL
      Hi,
      I use Apex 4.1.0.00.32 and Oracle Database 11gR2.
      In form a have number field - field1, without Format Mask. Field1 is field from database table (DataType - Number).

      I create validation String Comparison, Item / Column specified is numeric.
      When enter values diffrent from number (abc) I got error:
      Error     Error processing validation
      ORA-06502: PL/SQL: numeric or value error: character to number conversion error.
      The same error occurs when create validation PL/SQL-Function Returning Boolean.

      I would like to create validation that return message what field on form is wrong value eg.
      field1 has wrong value.
      Is there simple way to deny enter values diffrent from number in field1?

      Any idea.
      Thanks
        • 1. Re: Number field validation
          Denes Kubicek
          Dejan,

          You can have a look at this example:

          http://apex.oracle.com/pls/otn/f?p=31517:127

          The jQuery solution is a bit better. Still, you need to enhance your code to prevent entering "." characters more than once. However, at least it allows the numbers only and that is a good thing.

          Denes Kubicek
          -------------------------------------------------------------------
          http://deneskubicek.blogspot.com/
          http://www.apress.com/9781430235125
          http://apex.oracle.com/pls/apex/f?p=31517:1
          http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
          -------------------------------------------------------------------