Skip to main content
Known Participant
September 26, 2017
Question

Underlining a Single Word within a Text Field in Acrobat DC

  • September 26, 2017
  • 1 reply
  • 960 views

I would like to know if it is possible to underline a word within a text field. In my example below I want to underline the word MINOR: only.

This is my coding:

event.value="MINOR: " + this.getField(“BName”).valueAsString;

I want the above to look like this:

MINOR: Jane Doe

Is this possible?

Thank you

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
September 27, 2017

This is possible. Use rich text format in the text field and the JavaScript span object.

Angus24Author
Known Participant
September 27, 2017

Thanks for your response Bernd, but I'm still at a loss on how to do this.

Can you help me out with the coding for this?

Joel Geraci
Community Expert
Community Expert
September 27, 2017

See the documentation at the link below

Acrobat DC SDK Documentation

Example 1 will show you how to underline some text.

Example 2 shows you the rest of what you need to do to construct a set of span objects that have different formatting and then set that as the rich text value. In your use case, you'd need two spans.