These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Combine Text Fields (Agian Didnt Understand Other Post)

Str8gamE
Registered: Apr 1 2011
Posts: 5
Answered

Ok im a real newb to Adobe X Pro just got it a few days ago.
 
Trying something real simple and cant seem to figure it out.
I Have
 
Text3
Text2
Text1
Text6
 
Want them to Display in
 
Text8
 
No Idea where to start i find some java code boxes but no java i use works at a loss any help would be great thanks.

My Product Information:
Acrobat Pro Extended 10.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
When you say combine, what do you mean exactly? Numerical addition, string concatenation, something else?
Str8gamE
Registered: Apr 1 2011
Posts: 5
Oh im sorry ya i can get sum and stuff to work no there text fields that will compile the file name at the header.

string concatenation
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
OK. Now you need to tell us when you want the Text8 field to show the value. What should happen if Text3, 2, 1, or 6 are blank? You might want to give a bit more background so we have more details about what you're trying to accomplish.

A simple script that does what you indicated so far would look something like this:

  1. // Get the field values, as strings
  2. var s1 = getField("Text3").valueAsString;
  3. var s2 = getField("Text2").valueAsString;
  4. var s3 = getField("Text1").valueAsString;
  5. var s4 = getField("Text6").valueAsString;
  6.  
  7. // Set this field value by concatenating the strings
  8. event.value = s1 + s2 + s3 + s4;
Str8gamE
Registered: Apr 1 2011
Posts: 5
Well i want it to update that Text8 field whenever data is being entered so it can be all nulls or blanks untill they start enter the information its a trademark compliance form so Text 3 2 1 6 will be filled in always but blank at first.

Ya if there is not like an auto update then i need to refresh or something when Text 3 2 1 6 are typed in

Ill try the above do i just add that to the calc tab of text8?

thanks
Str8gamE
Registered: Apr 1 2011
Posts: 5
Accepted Answer
Oh no this code works great dont under stand why nothing i did didnt work i guess event.value is the Text8 Container?
Str8gamE
Registered: Apr 1 2011
Posts: 5
LOL duh meant to accept the above post #3 it worked perfect thanks guys