The problem is the number 0 is not registering in my progress bar at the top of the page. We are tracking required fields in the pdf so the person filling it out can go to the top and see they missed a required field and on which page.
Back to that problem when I type a address into the 10 separate form fields ( 1 0 5 6 S T R E E T ) the 0 is not showing up in my progress bar at the top. It shays only 9 fields have been completed. No 0's anywhere are registering. They show up in the fields just not in the progress bar at the top.
Thank you in advance.
//Turn off the warnings when JavaScript is enabled
this.getField("JavascriptWarning").display = display.visible;
this.getField("ProgressTracking").display = display.visible;
//Required fields warning
this.alerted = false;
//Define all required fields
this.first = this.getField("FirstName");
this.family = this.getField("FamilyName");
this.addressOne = this.getField("AddressOne");
this.addressTwo = this.getField("AddressTwo");
this.postcodeOne = this.getField("Postcode-1");
this.daytimeTelephone = this.getField("DaytimeTelephone");
this.payrollReference = this.getField("PayrollReference");
//---P46
this.nationalOne = this.getField("NationalInsurance1");
this.nationalTwo = this.getField("NationalInsurance2");
this.nationalThree = this.getField("NationalInsurance3");
this.nationalFour = this.getField("NationalInsurance4");
this.nationalFive = this.getField("NationalInsurance5");
this.nationalSix = this.getField("NationalInsurance6");
this.nationalSeven = this.getField("NationalInsurance7");
this.nationalEight = this.getField("NationalInsurance8");
this.nationalNine = this.getField("NationalInsurance9");
this.mr = this.getField("Mr");
this.surnameOne = this.getField("SurnameFamilyName-1");
this.firstOne = this.getField("FirstorGivenName-1");
this.dobOne = this.getField("DOB-1");
this.dobTwo = this.getField("DOB-2");
this.dobThree = this.getField("DOB-3");
this.dobFour = this.getField("DOB-4");
this.dobFive = this.getField("DOB-5");
this.dobSix = this.getField("DOB-6");
this.dobSeven = this.getField("DOB-7");
this.dobEight = this.getField("DOB-8");
this.houseOne = this.getField("HouseOrFlatNumber-1");
this.restAddressOne = this.getField("RestOfAddress-1");
this.dateOne = this.getField("Date-1");
//---Leidos Employee Bank Details For Payroll
this.employeeNumber = this.getField("EmployeeNumber");
this.bankName = this.getField("BankName");
this.bankAddressOne = this.getField("BankAddressOne");
this.bankAddressTwo = this.getField("BankAddressTwo");
this.bankPostcodeOne = this.getField("BankPostcode-1");
this.bankSortCodeOne = this.getField("BankSortCode-1");
this.bankAccountNumber = this.getField("BankAccountNumber-1");
this.effectiveDate = this.getField("EffectiveDate");
//---Baseline Personnel Security Standard
this.birthPlace = this.getField("PlaceOfBirth");
this.birthNationality = this.getField("NationalityAtBirth");
this.presentNationality = this.getField("PresentNationality");
//Load them all into an array
this.REQUIRED = [first, family, addressOne, addressTwo, postcodeOne, daytimeTelephone, payrollReference, nationalOne, nationalTwo, nationalThree, nationalFour, nationalFive, nationalSix, nationalSeven, nationalEight, nationalNine, mr, surnameOne, firstOne, dobOne, dobTwo, dobThree, dobFour, dobFive, dobSix, dobSeven, dobEight, houseOne, restAddressOne, dateOne, employeeNumber, bankName, bankAddressOne, bankAddressTwo, bankPostcodeOne, bankSortCodeOne, bankAccountNumber, effectiveDate, birthPlace, birthNationality, presentNationality ];
//Define the colors to be used
this.gray = ["RGB", 0.208, 0.208, 0.208];
this.amber = ["RGB", 0.992, 0.905, 0];
this.red = ["RGB", 0.937, 0.282, 0.212];
this.green = ["RGB", 0.431, 0.710, 0.016];
//Call the document-level functions to update the Checklist
updateAll();
function updateAll()
{
Dupdate();
EOWupdate();
LNHupdate();
EBDupdate();
BPSSupdate();
}
///
//Updates the P46 entry.
///
/*----------------NEW-------------------*/
function Dupdate()
{
this.DfieldCount = 0
this.DnumComplete = 0;
//Get all required fields in the form ----------- ecFirst, ecNationalOne
var postcodeOne = this.getField("Postcode-1");
var nationalOne = this.getField("NationalInsurance1");
var nationalTwo = this.getField("NationalInsurance2");
var nationalThree = this.getField("NationalInsurance3");
var nationalFour = this.getField("NationalInsurance4");
var nationalFive = this.getField("NationalInsurance5");
var nationalSix = this.getField("NationalInsurance6");
var nationalSeven = this.getField("NationalInsurance7");
var nationalEight = this.getField("NationalInsurance8");
var nationalNine = this.getField("NationalInsurance9");
var mr = this.getField("Mr");
var surnameOne = this.getField("SurnameFamilyName-1");
var firstOne = this.getField("FirstorGivenName-1");
var dobOne = this.getField("DOB-1");
var dobTwo = this.getField("DOB-2");
var dobThree = this.getField("DOB-3");
var dobFour = this.getField("DOB-4");
var dobFive = this.getField("DOB-5");
var dobSix = this.getField("DOB-6");
var dobSeven = this.getField("DOB-7");
var dobEight = this.getField("DOB-8");
var houseOne = this.getField("HouseOrFlatNumber-1");
var restAddressOne = this.getField("RestOfAddress-1");
var dateOne = this.getField("Date-1");
var dFields = [postcodeOne, nationalOne, nationalTwo, nationalThree, nationalFour, nationalFive, nationalSix, nationalSeven, nationalEight, nationalNine, mr, surnameOne, firstOne, dobOne, dobTwo, dobThree, dobFour, dobFive, dobSix, dobSeven, dobEight, houseOne, restAddressOne, dateOne];
//Check required fields for completion and visibility
for (var i in dFields)
{
if (dFields[i].display == display.visible)
{
this.DfieldCount++;
if (dFields[i].value != "")
{
this.DnumComplete++;
}
}
}
var t = this.getField("PFourtySix");
if (DnumComplete == 0)
{
t.fillColor = this.gray;
this.getField("DProgress").userName = "";
}
else if (DnumComplete < DfieldCount)
{
t.fillColor = this.amber;
this.getField("DProgress").userName = "";
}
else
{
t.fillColor = this.green;
}
this.getField("DProgress").value = this.DnumComplete + "/" + this.DfieldCount;
if (this.DnumComplete == this.DfieldCount) this.getField("DProgress").userName = "Done";
}
///
//Updates the Leidos Expression of Wish entry.
///
/*----------------NEW-------------------*/
function EOWupdate()
{
this.EOWfieldCount = 0
this.EOWnumComplete = 0;
//Get all required fields in the form ----------- ecFirst, ecFamily, ecAddressOne, ecAddressTwo, ecPostcodeOne, ecNationalOne
var first = this.getField("FirstName");
var family = this.getField("FamilyName");
var addressOne = this.getField("AddressOne");
var addressTwo = this.getField("AddressTwo");
var postcodeOne = this.getField("Postcode-1");
var daytimeTelephone = this.getField("DaytimeTelephone");
var payrollReference = this.getField("PayrollReference");
var nationalOne = this.getField("NationalInsurance1");
var nationalTwo = this.getField("NationalInsurance2");
var nationalThree = this.getField("NationalInsurance3");
var nationalFour = this.getField("NationalInsurance4");
var nationalFive = this.getField("NationalInsurance5");
var nationalSix = this.getField("NationalInsurance6");
var nationalSeven = this.getField("NationalInsurance7");
var nationalEight = this.getField("NationalInsurance8");
var nationalNine = this.getField("NationalInsurance9");
var dobOne = this.getField("DOB-1");
var dobTwo = this.getField("DOB-2");
var dobThree = this.getField("DOB-3");
var dobFour = this.getField("DOB-4");
var dobFive = this.getField("DOB-5");
var dobSix = this.getField("DOB-6");
var dobSeven = this.getField("DOB-7");
var dobEight = this.getField("DOB-8");
var eowFields = [first, family, addressOne, addressTwo, postcodeOne, daytimeTelephone, payrollReference, nationalOne, nationalTwo, nationalThree, nationalFour, nationalFive, nationalSix, nationalSeven, nationalEight, nationalNine, dobOne, dobTwo, dobThree, dobFour, dobFive, dobSix, dobSeven, dobEight ];
//Check required fields for completion and visibility
for (var i in eowFields)
{
if (eowFields[i].display == display.visible)
{
this.EOWfieldCount++;
if (eowFields[i].value != "")
{
this.EOWnumComplete++;
}
}
}
var t = this.getField("ExpressionWish");
if (EOWnumComplete == 0)
{
t.fillColor = this.gray;
this.getField("EOWProgress").userName = "";
}
else if (EOWnumComplete < EOWfieldCount)
{
t.fillColor = this.amber;
this.getField("EOWProgress").userName = "";
}
else
{
t.fillColor = this.green;
}
this.getField("EOWProgress").value = this.EOWnumComplete + "/" + this.EOWfieldCount;
if (this.EOWnumComplete == this.EOWfieldCount) this.getField("EOWProgress").userName = "Done";
}
///
//Updates the Leidos Limited New Hires entry.
///
/*----------------NEW-------------------*/
function LNHupdate()
{
this.LNHfieldCount = 0
this.LNHnumComplete = 0;
//Get all required fields in the form ----------- ecFirst, ecFamily
var first = this.getField("FirstName");
var family = this.getField("FamilyName");
var lnhFields = [first, family ];
//Check required fields for completion and visibility
for (var i in lnhFields)
{
if (lnhFields[i].display == display.visible)
{
this.LNHfieldCount++;
if (lnhFields[i].value != "")
{
this.LNHnumComplete++;
}
}
}
var t = this.getField("LimitedNewHires");
if (LNHnumComplete == 0)
{
t.fillColor = this.gray;
}
else if (LNHnumComplete < LNHfieldCount)
{
t.fillColor = this.amber;
}
else
{
t.fillColor = this.green;
}
this.getField("LNHProgress").value = this.LNHnumComplete + "/" + this.LNHfieldCount;
if (this.LNHnumComplete == this.LNHfieldCount) this.getField("LNHProgress").userName = "Done";
else this.getField("LNHProgress").userName = "";
}
///
//Updates the Leidos Employee Bank Details for Payroll entry.
///
/*----------------NEW-------------------*/
function EBDupdate()
{
this.EBDfieldCount = 0
this.EBDnumComplete = 0;
//Get all required fields in the form -----------
var first = this.getField("FirstName");
var family = this.getField("FamilyName");
var employeeNumber = this.getField("EmployeeNumber");
var bankName = this.getField("BankName");
var bankAddressOne = this.getField("BankAddressOne");
var bankAddressTwo = this.getField("BankAddressTwo");
var bankPostcodeOne = this.getField("BankPostcode-1");
var bankSortCodeOne = this.getField("BankSortCode-1");
var bankAccountNumber = this.getField("BankAccountNumber-1");
var effectiveDate = this.getField("EffectiveDate");
var ebdFields = [first, family, employeeNumber, bankName, bankAddressOne, bankAddressTwo, bankPostcodeOne, bankSortCodeOne, bankAccountNumber, effectiveDate ];
//Check required fields for completion and visibility
for (var i in ebdFields)
{
if (ebdFields[i].display == display.visible)
{
this.EBDfieldCount++;
if (ebdFields[i].value != "")
{
this.EBDnumComplete++;
}
}
}
var t = this.getField("EmployeeBankDetails");
if (EBDnumComplete == 0)
{
t.fillColor = this.gray;
}
else if (EBDnumComplete < EBDfieldCount)
{
t.fillColor = this.amber;
}
else
{
t.fillColor = this.green;
}
this.getField("EBDProgress").value = this.EBDnumComplete + "/" + this.EBDfieldCount;
if (this.EBDnumComplete == this.EBDfieldCount) this.getField("EBDProgress").userName = "Done";
else this.getField("EBDProgress").userName = "";
}
///
//Updates the Baseline Personnel Security Standard entry.
///
/*----------------NEW-------------------*/
function BPSSupdate()
{
this.BPSSfieldCount = 0
this.BPSSnumComplete = 0;
//Get all required fields in the form -----------
var first = this.getField("FirstName");
var family = this.getField("FamilyName");
var addressOne = this.getField("AddressOne");
var addressTwo = this.getField("AddressTwo");
var postcodeOne = this.getField("Postcode-1");
var daytimeTelephone = this.getField("DaytimeTelephone");
var dobOne = this.getField("DOB-1");
var dobTwo = this.getField("DOB-2");
var dobThree = this.getField("DOB-3");
var dobFour = this.getField("DOB-4");
var dobFive = this.getField("DOB-5");
var dobSix = this.getField("DOB-6");
var dobSeven = this.getField("DOB-7");
var dobEight = this.getField("DOB-8");
var birthPlace = this.getField("PlaceOfBirth");
var birthNationality = this.getField("NationalityAtBirth");
var presentNationality = this.getField("PresentNationality");
var bpssFields = [first, family, addressOne, addressTwo, postcodeOne, daytimeTelephone, dobOne, dobTwo, dobThree, dobFour, dobFive, dobSix, dobSeven, dobEight, birthPlace, birthNationality, presentNationality];
//Check required fields for completion and visibility
for (var i in bpssFields)
{
if (bpssFields[i].display == display.visible)
{
this.BPSSfieldCount++;
if (bpssFields[i].value != "")
{
this.BPSSnumComplete++;
}
}
}
var t = this.getField("Baseline");
if (BPSSnumComplete == 0)
{
t.fillColor = this.gray;
}
else if (BPSSnumComplete < BPSSfieldCount)
{
t.fillColor = this.amber;
}
else
{
t.fillColor = this.green;
}
this.getField("BPSSProgress").value = this.BPSSnumComplete + "/" + this.BPSSfieldCount;
if (this.BPSSnumComplete == this.BPSSfieldCount) this.getField("BPSSProgress").userName = "Done";
else this.getField("BPSSProgress").userName = "";
}