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

LiveCycle Address Field

x_kayla_x
Registered: May 26 2010
Posts: 2

Hello,

I apologies if this question has been asked before, Im new to LiveCycle and so most of your posts are a bit complex for me.

Basically, I need to create 400 certificates and email as PDF. I have purchased an add on for adobe to let me mail merge, so that we do not have to do a mail merge by word and manually convert and email them.

After spending a few days playing around with LiveCyle, I have created a good template apart from the small problem of an address line. We have to have the delegates address at the top, which gets pulled from our database, and the problem is not everyone has every field of the database completed. Some people have only supplied a postcode, some have supplied an address line, town, county, country etc. I need to be able to put this into my form, and if the field is blank have the next field jump up so that it will not leave a gap.

Does anyone know a way to do this? Or possibly point me in the right direction of a tutorial on how to do this? It may be ridiculously simple, but as I saw im new to this :)

Thank you for any help

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
You will need a script that sees what fields you have data for or are empty and then assemble the fields in the correct order that have data. The best example of this that I found was in the form samples provided with Acrobat 4. The script uses was a function that accepted 3 fields and an optional separator and then would concatenate the fields with data and insert the optional separator if needed. Since the original code was for Acrobat forms you may need to adjust the script to the LiveCycle syntax or use the function as a document level function or an application folder function. Following is the original function rewritten with comments to show how to use binary values to make the decision as to how to select an action based upon what is supplied. The function has to be called with 3 parameters, but one can use a null value to provide a no field value. You may need to call this several times to obtain the result that you want to achieve with the separator.

function fillin(s1, s2, s3, sep) {// Concatenate 3 strings with separators where needed // convert passed strings to a string values1 = s1.toString();s2 = s2.toString();s3 = s3.toString(); // assign a numeric value for presence of a given string(s)var test = 0; // no passed stringsif (s1 != "") test += 1; // s1 has a valueif (s2 != "") test += 2; // s2 has a valueif (s3 != "") test += 4; // s3 has a value // return appropriate combination based on passed stringsif (test == 0) return ""; // no stings passedif (test == 1) return s1; // s1 onlyif (test == 2) return s2; // s2 onlyif (test == 3) return s1 + sep + s2; // s1 and s2if (test == 4) return s3; // s3 onlyif (test == 5) return s1 + sep + s3; // s1 and s3if (test == 6) return s2 + sep + s3; // s2 and s3if (test == 7) return s1 + sep + s2 + sep + s3; // s1, s2, and s3}

George Kaiser