validations

Certified Associate Developer

Hi, I need a validation that the user can enter only numbers from 01-99 . How can we do this?
Is there any range function or limit function to check it?

  Discussion posts and replies are publicly visible

Parents
  • Assuming the field you're using to capture the data is an Integer field you can write a validation on that field:

    {
      a!integerField(
        label: "Integer",
        labelPosition: "ABOVE",
        value: ri!myInteger,
        saveInto: {
          ri!myInteger
        },
        refreshAfter: "UNFOCUS",
        validations: {
          if(
            fn!or(
              ri!myInteger<0,
              ri!myInteger>99
            ),
            "Invalid value - out of range (0-99)",
            null
          )
        }
      )
    }

Reply
  • Assuming the field you're using to capture the data is an Integer field you can write a validation on that field:

    {
      a!integerField(
        label: "Integer",
        labelPosition: "ABOVE",
        value: ri!myInteger,
        saveInto: {
          ri!myInteger
        },
        refreshAfter: "UNFOCUS",
        validations: {
          if(
            fn!or(
              ri!myInteger<0,
              ri!myInteger>99
            ),
            "Invalid value - out of range (0-99)",
            null
          )
        }
      )
    }

Children