Here, we talk about some ways to validate a rich text field.The first way to validate a rich text field is to check to see if there is anything in the field.The goal of the validation is to display an error message if user selects 'Yes' but leaves the comment field blank/null.
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.
.value == null#3cf Values['Select List'] == 'Yes' && cf Values['Text Line'].value == nulland others.
I've also added the following before the condition to check the logs to see if the values of the custom fields are as expected and they are...
This code works by going to the field ("Body" in our example) and then attempting to select and deselect all the contents of the rich text field.
Those statements will cause an error ("Document command is not available") if the field is empty.Rich Text fields don't have the Input Validation event, so you can't directly validate the field.But you can set up another field to do the validation.So we trap for the error, and if it occurs clear out the error handler and give the user an error message and don't allow the document to be saved by setting ) and jump the user back to that field when finished, but the jumping will still happen.Furthermore, the entire rich text field will be selected and deselected.checks for the presence of attachments on the document, not necessarily the field in question.