Restricting user from entering text after certain character limit

Certified Senior Developer

Hi all,
We have a business requirement where the user will enter data into a text field and if the data reaches a certain character limit say 100, we should not allow users to type more than 100. Like they want it to be freezed or stopped at 100 character length? We are showing character limit validation but they want some kind of restriction. Is it possible to achieve to such feature?

  Discussion posts and replies are publicly visible

Parents
  • You can try using the below code:

    a!localVariables(
      local!description,
      a!textField(
        label: "Description",
        instructions: "You can only add 100 characters in this field, system will auto trim the characters after 100th character",
        value: local!description,
        saveInto: {
          a!save(local!description, left(save!value, 100))
        }
      )
    )

    This way it will never throw the validation but auto trim the characters after 100.

Reply
  • You can try using the below code:

    a!localVariables(
      local!description,
      a!textField(
        label: "Description",
        instructions: "You can only add 100 characters in this field, system will auto trim the characters after 100th character",
        value: local!description,
        saveInto: {
          a!save(local!description, left(save!value, 100))
        }
      )
    )

    This way it will never throw the validation but auto trim the characters after 100.

Children