Skip to main content
Known Participant
November 4, 2017
Answered

Bold & justify text field text

  • November 4, 2017
  • 2 replies
  • 3471 views

Hi, I have auto updating text field in my form second page. I’m updating first page field ”aa” & second page text filed auto updating..

I have used bellow code to manage that..

// Get field values

var one = getField('aa').value;

// Build para string

var para = "WHEREAS, pursuant to the transfer of the real property commonly known as " + one + ", by Assignee, Assignor wishes to assign and transfer all of its interest in the Lease Agreement(s) present or future to Assignee, and Assignee wishes to accept the foregoing Assignment from Assignor and assume all of the rights and obligations under the Lease Agreement(s) present and future;" ;

// Set this field's value equal to para

event.value = para;

what I want is,

  1. I want to justify the text in second page auto filling text field.
  2. I want to bold “"WHEREAS,” text.

I have already tried Ctrl +e option & it’s work. The issue is if I change first page “aa” value, second page auto filling text field, “Ctrl+e” all the settings automatically removing & just showing normal text. Can u pls help me to solve this issue. Thanks..

This topic has been closed for replies.
Correct answer try67

hi, thanks. Justify mean all the text need to distribute evenly between the margins.. is that possible to provide correct code ?? i don't have idea about JavaScript & your help is much appreciating. thanks..


I don't think it's possible to achieve this justification using a script.

To apply the bold text use this:

var one = this.getField("aa").valueAsString;

var spans = [];

var span1 = {};

span1.fontWeight = 700;

span1.text = "WHEREAS";

spans.push(span1);

var span2 = {};

span2.text = ", pursuant to the transfer of the real property commonly known as " + one + ", by Assignee, Assignor wishes to assign and transfer all of its interest in the Lease Agreement(s) present or future to Assignee, and Assignee wishes to accept the foregoing Assignment from Assignor and assume all of the rights and obligations under the Lease Agreement(s) present and future;" ;

spans.push(span2);

event.richValue = spans;

2 replies

omanbuxAuthor
Known Participant
November 5, 2017

thanks lot for the both codes & both codes are working perfectly. combining that both codes, i have created bellow code & it's working. thanks again for the both codes. thanks..

var one = this.getField("aa").valueAsString; 

var spans = []; 

 

var span1 = {}; 

span1.fontWeight = 700; 

span1.text = "WHEREAS"; 

spans.push(span1); 

 

var span2 = {}; 

span2.alignment = "justify",

span2.text = ", pursuant to the transfer of the real property commonly known as " + one + ", by Assignee, Assignor wishes to assign and transfer all of its interest in the Lease Agreement(s) present or future to Assignee, and Assignee wishes to accept the foregoing Assignment from Assignor and assume all of the rights and obligations under the Lease Agreement(s) present and future;" ; 

spans.push(span2); 

event.richValue = spans;

try67
Community Expert
Community Expert
November 4, 2017

1. What kind of justification?

2. This can be done using the Rich Text Formatting option. You need to enable that option for you field (which it sounds like you did already), and then apply an array of Span objects to the richValue property of the field, instead of applying a plain string to the value property.

omanbuxAuthor
Known Participant
November 4, 2017

hi, thanks a lot for your reply. i have already enabled Rich Text Formatting. so u mean i have to update the code ?? i have found this code from adobe forum & used so is that possible to provide correct code?. thanks in advance..

try67
Community Expert
Community Expert
November 4, 2017

Yes. You, or someone else, will need to update the code.