Validating text field
This input validation would trap for a rich text field with no text: and then trimming it to remove spaces.
If we're left with an empty string, then there is no text in the rich text field.
My personal preference is to use the second method.
If the user is putting in a link or an attachment or something besides text, they almost always add a couple of words to indicate what else they added to the field, and those added words will cause the validation to pass.
But what if the user can put in an attachment and no text?
It either parses the first condition or not at all.cf Values['Select List'].value.contains('Yes') && cf Values['Text Line']?.value == null Variations#1if (cf Values['Select List'].value.contains('Yes'))#2if (cf Values['Select List'].value.contains('Yes')) cf Values['Text Line']?If the user has typed in a few paragraphs, they will see the flash of that selecting/deselecting process.
That can be unnerving to users ("did they do something to my text? Another method used for validating rich text content is to use validation in a hidden field.
.value == null#3cf Values['Select List'] == 'Yes' && cf Values['Text Line'].value == nulland others.