Skip to main content
sameeru0003
January 6, 2025
Question

paragraphfield in an interface is considering enters, tabs and spaces only as a value

  • January 6, 2025
  • 6 replies
  • 0 views

Hi All,

I have a paragraph field (* Required field) in an interface. When I input Enters or Spaces or Tabs only and no other characters it is consider as a value and not firing the validation error. For user it looks like empty values and validation didn't fired. Need a validation so that Enters or Spaces or Tabs only are not considered as va[lues.

a!paragraphField(
.....


validations: ???

......
)

6 replies

venkatrea696188
January 6, 2025

Use trim function to remove extra spaces from value .

if(a!isNullOrEmpty(fn!trim(Your Variable)),"Please enter value","")

sameeru0003
January 6, 2025

This is returning "" when i pass enter in place of Your Variable. Instead it should return "Please enter value"

venkatrea696188
January 6, 2025

a!localVariables(
  local!X,
  {
  a!paragraphField(
    label: "Paragraph",
    labelPosition: "ABOVE",
    value: local!X,
    saveInto: {local!X},
    refreshAfter: "UNFOCUS",
    height: "MEDIUM",
    validations: {
      if(a!isNullOrEmpty(fn!trim(local!X)),"Please enter value","")
    }
  )
})

Your variable means where you ar5e storing the value of paragraph field . Can we see your code of the paragraph field