3 Comments

I don’t recall the properties for upper, middle, and bottom of a field (in properties of an array of Span objects or the Field property). I’m curious to see how that’s done in JavaScript. I look forward to the next entry.

Also, is there a way to specify a maximum or minimum font size? That is, you’re willing to change font size (as if you had specified font size 0, but it will stop at (say) point size 12?

Expand full comment

To cap the font size at 12, enter the following validation script into the field:

var rv=event.richValue;

for(var i=0;i<rv.length;i++)

{

if(rv[i]["textSize"]>12)

{

rv[i]["textSize"]=12;

}

}

event.richValue=rv;

Expand full comment

Hi John, Thank you for the feedback. Unfortunately, not every property on the Rich Text formatting toolbar can be set with JavaScript. Among those that can't are the upper, middle, and bottom field alignment settings. Regarding limiting the font size, you would have to run a custom validation script that creates a new richValue array that is copy of the original array, with modifications to the textSize property if necessary, then replace the previous richValue array with the new one. I will work on an example and either post it here, or include it in the next article.

Expand full comment