21 digits number

Hello All 

I want to add a field that accept only 21 digits of number I tried to use a!integerField but is not allowed to enter too long numbers 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Try the below code and lemme know if it works for you

    a!localVariables(
      local!input,
      a!textField(
        label: "Text",
        labelPosition: "ABOVE",
        value: local!input,
        saveInto: local!input,
        refreshAfter: "UNFOCUS",
        validations: if(
          a!isNullOrEmpty(local!input),
          {},
          if(
            or(
              len(local!input) > 21,
              regexmatch("[^0-9.]", local!Input)
            ),
            "Invalid Input",
            ""
          )
        )
      )
    )

Reply
  • 0
    Certified Senior Developer

    Try the below code and lemme know if it works for you

    a!localVariables(
      local!input,
      a!textField(
        label: "Text",
        labelPosition: "ABOVE",
        value: local!input,
        saveInto: local!input,
        refreshAfter: "UNFOCUS",
        validations: if(
          a!isNullOrEmpty(local!input),
          {},
          if(
            or(
              len(local!input) > 21,
              regexmatch("[^0-9.]", local!Input)
            ),
            "Invalid Input",
            ""
          )
        )
      )
    )

Children