Skip to main content
Known Participant
Sep 7, 2023 6:01 PM UTC
Solved

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

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?

    harshitb6843
    Brainy
    Sep 7, 2023 6:21 PM UTC

    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
    Brainy
    Sep 7, 2023 6:21 PM UTC

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

    Known Participant
    Sep 7, 2023 8:28 PM UTC

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

    Thank you!