• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Force Integer value in a form

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Force Integer value in a form

    We have a form used to enter order lines. The quantity field in the data source is defined as 13,2.

    I would like to force the user to enter the quantity as an integer without having to modify the data source (it is based off our ERP database).

    Is that possible within NAB, or do I need to add something to the existing form helper program?

  • #2
    You can set the "Validate as" to "regex" and then supply the regex value as ^\d+$

    This will not prevent them from typing it in but will give an error when they do. If your button is conditioned on the "isValid" property of the form then you can disable the save (or similar) button when in error.

    Comment


    • #3
      Thanks Sean! I actually used the Valence assistant because the regex above would not allow negative numbers. Ended up with:

      ^-?\d+$

      This seems to work

      Comment

      Working...
      X