How to validate rich text field?

HI all,

I want to validate a rich text field, therefore i use JavaScript:

var temp = document.forms[0].CDescription;

DescriptionVal = temp.value;

if (DescriptionVal ==“”)

{

	alert("You must enter a description!");

	temp.focus();

}

But, if i attach a file in this field, and no other char is entered, then the alert still pop up, it does not treat the attachment as a “char”. How do i solve this problem? Thanks.

Subject: How to validate rich text field?

create a text field say “dspHasAttach” and make it “Computed for Display” with the field as@If(@Attachments;“1”;“0”)

So if the field value is “1” that means there are attachments in the document, else the field value should be “0”.

Now in your validation, use this field value to validate

ie

var temp = document.forms[0].CDescription;

DescriptionVal = temp.value;

if (DescriptionVal == “” && document.forms[0].dspHasAttach.value == “0”)

{

alert(“You must enter a description!”);

temp.focus();

}

hope this helps!!

Subject: RE: How to validate rich text field?

Thank you!