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

Inserting Conditional Text between Floating Fields

uschad
Registered: Mar 3 2010
Posts: 19
Answered

I have two data fields that flow fine to their specific floating fields. field1 has a name1 and field2 has a name2. I have them carry down and read using two floating fields to read "(name2) (name 1) Form" what i would like to do is to have the word "and" appear between the two floating fields...but only when there is something entered into field2 that contains the second name. So the final result should 2 names be entered would be "(name2) and (name1) Form".

I have worked on this for a bit and can't seem to get it to work. Any help would be great.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

this is much easier as you might think.
Simply add a third floating field to your text between "name2" and "name1".
The text then should look like "{name2}{AddAnd}{name1} Form" (Do not add any space between the floating fields!)
Rename the third floating field to "AddAnd" and add this script to the change:event of name2.

if(xfa.event.newText != null){AddAnd.rawValue = " and ";}else{AddAnd.rawValue = "";}

That's all.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

uschad
Registered: Mar 3 2010
Posts: 19
I think I know part of the problem now. These floating fields are on a second page. When I follow your instructions and place the "Addand" field on the same page as the Name 2 field I am fine. But when i try to get it to work on the second page it does not work. Is this possible? Thanks for the response.
uschad
Registered: Mar 3 2010
Posts: 19
I was able to get it to work after I kept at it. Thanks again.