Hi. I got a little help w/ this a while back. I finally started to use the code/form and noticed the leading zero was being dropped from the postal code. Is there any way I can convert the number to a text so that doesn't happen? I tried a few things that I found on this site and others but none seem to work. This will need to work for Adobe Acrobat vers 6 and up.
Thanks!
// Concatenate Investigator Postal Address, i.e. City, State and Zip
// Custom calculation script for "Investigator.PostalAdd"
// Get field references
// Written w/ the help of gkaiseril from the Acrobat User Community Group
var cCITY = this.getField("Investigator.CITY").value;
var oSTATE = this.getField("Investigator.STATEID.STATELIST");
var cZIP = this.getField("Investigator.ZIP").value;
var xPostalAdd = this.getField("Investigator.PostalAdd");
// get combo box state item name
var cSTATEitemName = ""; // clear field
// loop through combo box for match to export value to item in combo box list
for (i = 0; i < oSTATE.numItems; i++)
{ if(oSTATE.getItemAt(i, true) == oSTATE.value)
{
cSTATEitemName = oSTATE.getItemAt(i, false); // get item name
break; // end loop on match
} // end if match
} // end for loop
xPostalAdd.value = ""; // clear field
// fillin if all fields have a value
if ((cCITY != "") || (cSTATEitemName != "") || (cZIP != ""))
{
// Set this field value by concatenating the other fields
xPostalAdd.value = cCITY + ", " + cSTATEitemName + " " + cZIP;
}
See the discussion here: http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=21311
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com