Copy link to clipboard
Copied
Hi,
setting the value does not work in the "Validate" event. I have the field set correctly to richText, but even when I use event.richValue or event.target.richValue, the text still does not appear in the field. On Mouse events event.target.richValue works normally.
Here is my code:
// inputed in Validate
span1 = {text: "Hi, There!"};
event.richValue = [span1];
Copy link to clipboard
Copied
To apply a value you should use the Calculate event.
Copy link to clipboard
Copied
I don't want to use Calculate, I want Validate.
Specifically, it doesn't work to insert a value if the field is empty.
if(event.richValue.length===0){
span1 = {text: "Hi, There!"};
event.richValue = [span1]
};
Here is my code:
Copy link to clipboard
Copied
What are you trying to achieve here, exactly?
Copy link to clipboard
Copied
If you want to set the field's value to this text when it's empty just change the first line to:
if (event.value.length==0) {