Q:

Replace font with based on character count with javascript in a Acrobat Form

Is this possible?
I basically want to use a different font, if the length of character is over a certain count.
I would need the javascript code to plug into Custom Calculation Scripts to do the following:
If the length of the typed text in the form is greater that 30 characters, I want to use Arial Narrow, if under, then just use Arial.  The font would always need to be 11 pt in all cases.
Really not a programmer here or know anything about javascript. 

A:

Add the following script to the fields custom format action.
if (event.target.value.length > 30) {
    event.target.textFont = "ArialNarrow";
}
else {
    event.target.textFont = "Arial";
}

The font will change after the user commits the value by pressing enter, tabbing out of the field, or clicking off the field.

