I don't do much with rich text... thank goodness... :)
You might want to try changing your if statement...
instead of:
if (value == "") {
You may want to try:
if ( "".equals(value)) {
this really is necessary in Java - which is what really runs XPages. I'm a little uncertain about it for SSJS... but I believe it's the better way to go.
Basically in Java a literal string is an Object. so the literal "Test" is an object the same as your variable "values" is an object. And even if the text "Test" was inside the variable "values", the test if ("Test" == values) is comparing 2 different objects and those objects are not equal to each other.
But if you did : if ("Test".equals(value))
then it knows to look not at the objects themselves but the strings inside them.
So you can say if ( "".equals(values) {
to mean if the contents of values is a blank or "" then it's true.
Sorry I rambled there but that's an important distinction in XPages String comparison.
Hope that helps
Dave