I created a custom list form that uses a SharePoint rich text field as shown below:
<SharePoint:FormField runat="server" ID="spfldDetails" FieldName="Details" ControlMode="Edit" />
I then ran into the issue of trying to dynamically validate whether this field had any user-entered data when the form was submitted. The problem is that the field stores the html of the rich text so that even though the user doesn't enter any valid data, the value of the field is still something like "<div></div>" or "<div class=…></div>" making it tricky to determine whether or not the field is actually 'empty'.
Then I discovered the ConvertSimpleHtmlToText method of the SPHttpUtility class. I used this to perform simple validation as follows:
string detailsText = SPHttpUtility.ConvertSimpleHtmlToText(Convert.ToString(spfldDetails.Value), -1);
if (String.IsNullOrEmpty(detailsText.Trim()))
{
lblDetailsError.Text = "You must enter a value for this required field.";
return;
}