Skip to main content
September 7, 2023
Solved

What is the best way to set a minimum number of characters validation for a input text component?

  • September 7, 2023
  • 2 replies
  • 0 views

Hi all,

I'm trying to see what is the best way to assign a minimum character number for a text component in a interface?

    Best answer by harshitb6843

    a!localVariables(
      local!text,
      a!textField(
        value: local!text,
        saveInto: local!text,
        validations: if(
          len(local!text)<3,
          "Enter minimum 3 characters",
          ""
        )
      )
    )

    2 replies

    harshitb6843
    September 7, 2023

    a!localVariables(
      local!text,
      a!textField(
        value: local!text,
        saveInto: local!text,
        validations: if(
          len(local!text)<3,
          "Enter minimum 3 characters",
          ""
        )
      )
    )

    September 7, 2023

    Thank you! I also found documentation about it, I was using length() function thats why it wasn't working.

    Thank you!