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: ??? ...... )
Discussion posts and replies are publicly visible
Use trim function to remove extra spaces from value .
if(a!isNullOrEmpty(fn!trim(Your Variable)),"Please enter value","")
This is returning "" when i pass enter in place of Your Variable. Instead it should return "Please enter value"
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
The input to the paragraph field is a enter key value. Since its not a visible text the field should through validation error.
For your validation expression
if(a!isNullOrEmpty(fn!trim(local!X)),"Please enter value","")
if the value of local!X is a enter key value the validation is still not firing. I want the validation error if any keyboard keys input to this paragraphfield is not a visible text to the user ex: enter key or space key or tab key inputs.
Than wrap it with Stripwith function to remove the Enter key / Tab key character values.
if(a!isNullOrEmpty(fn!trim(stripwith(local!X,char(10)))),"Please enter value","")
Thanks! it helped to resolve the issue