validate number without using regex

Hi All,

Is there any way to validate number without using regex.

Here is the requirement,

Need to enter  only number upto 15-18 character. I can't use here integer or floating-point field so I am using textbox with regexmatch function to validate but my requirement to not use regexmatch function.

Is there any way to achieve this ?

  Discussion posts and replies are publicly visible

Parents
  • There are a few ways to achieve this.  Here's a working example utilizing cleanwith() to automatically remove alpha characters, and validates length of up to 18.

    a!localVariables(
      local!data,
      {
        a!textField(
          label: "Enter Data",
          value: local!data,
          saveInto: a!save(local!data,cleanwith(save!value,"1234567890")),
          validations: {
            if(
              len(local!data)>18,
              "Please enter a number up to 18 characters",
              null
            )
          }
        )
      }
    )

Reply
  • There are a few ways to achieve this.  Here's a working example utilizing cleanwith() to automatically remove alpha characters, and validates length of up to 18.

    a!localVariables(
      local!data,
      {
        a!textField(
          label: "Enter Data",
          value: local!data,
          saveInto: a!save(local!data,cleanwith(save!value,"1234567890")),
          validations: {
            if(
              len(local!data)>18,
              "Please enter a number up to 18 characters",
              null
            )
          }
        )
      }
    )

Children
No Data