Count of Characters in Paragraph field

Hi All,

     I have a Paragraph field in the grid, which i have limited to 500 char, but i want to show the count of characters below the paragraph, for that am using Instructions,still with no luck,

    Can anyone please help me on this,

    

a!paragraphField(
                              value: fv!item.comments,
                              saveInto: fv!item.comments,
                              height: "SHORT",
                              instructions: "Number of characters " & len(fv!item.comments) & "/500",
    refreshAfter: "KEYPRESS",
                              disabled: if(
                                local!accessoftheGroups = cons!CMP_GROUP_ACCESS_VALUES[2],
                                true,
                                false
                              ),
                              validations: if(
                                len(fv!item.comments) <= 500,
                                "",
                                "500 characters maximum."
                              )
                            )

    Thanks in advance

Warm Regards

Vineeth

  Discussion posts and replies are publicly visible

Parents Reply
  • Until the upgrade, I can only suggest utilizing the validation parameters on both the paragraph fields and on the grid itself - this will show hover over on the paragraph field as well as line by line errors underneath the grid. Additionally, you could add a skinny column next to the paragraph field for a length display - but as the others have noted here, this is probably about the best you can do until you upgrade. 

    a!localVariables(
      local!data: {
        {field1: ""},
        {field1: ""}
      },
      local!maxLength: 500,
      a!gridLayout(
        label: "Grid",
        headerCells: {
          a!gridLayoutHeaderCell(label: "Field 1"),
          a!gridLayoutHeaderCell(label: "Validation")
        },
        rows: a!forEach(
          items: local!data,
          expression: a!gridRowLayout(
            id: fv!index,
            contents: {
              a!paragraphField(
                value: fv!item.field1,
                saveInto: local!data[fv!index].field1,
                required: true,
                validations: {
                  if(
                    len(local!data[fv!index].field1)>local!maxLength,
                    concat("Please enter less than ",local!maxLength," characters.  Current length: ",len(local!data[fv!index].field1)),
                    null
                  )
                }
              ),
              a!richTextDisplayField(
                value: {
                  a!richTextItem(
                    text: concat("Length ",len(fv!item.field1),"/",local!maxLength),
                    style: "EMPHASIS",
                    color: "SECONDARY"
                  )
                }
              )
            }
          )
        ),
        validations: {
          reject(
            fn!isnull,
            a!forEach(
              items: local!data,
              expression: {
                if(
                  len(fv!item.field1)>local!maxLength,
                  concat("Please enter less than ",local!maxLength," characters in line ",fv!index,".  Current length: ",len(fv!item.field1)),
                  null
                )
              }
            )
          )
        },
        addRowLink: a!dynamicLink(
          label: "Add a Row",
          saveInto: a!save(local!data,append(local!data,{field1: null}))
        )
      )
    )

Children
No Data