Skip to content

Instantly share code, notes, and snippets.

@weiserman
Created January 16, 2014 08:48
Show Gist options
  • Select an option

  • Save weiserman/8451712 to your computer and use it in GitHub Desktop.

Select an option

Save weiserman/8451712 to your computer and use it in GitHub Desktop.
Form Calc example on Adobe Interactive Form for checking address values
data.Page1.Personal_Details.Personal_Details_Fields.Original_Data1.HSNMR1[1]::preSave - (FormCalc, client)
if (STRAS1[0].rawValue <> null) then
if (ORT021[1].rawValue == null or PSTLZ1[0].rawValue == null or ORT011[0].rawValue == null or STRAS1[0].rawValue == null) then
xfa.host.messageBox("Please supply at least Street Name, District/Suburb, City and Postal Code. Full address must be supplied for changes.", "Residential Address", 3, 1)
endif
elseif (POSTA1[0].rawValue <> null) then
if (ORT021[1].rawValue == null or PSTLZ1[0].rawValue == null or ORT011[0].rawValue == null or STRAS1[0].rawValue == null) then
xfa.host.messageBox("Please supply at least Street Name, District/Suburb, City and Postal Code. Full address must be supplied for changes.", "Residential Address", 3, 1)
endif
elseif (LOCAT1[0].rawValue <> null) then
if (ORT021[1].rawValue == null or PSTLZ1[0].rawValue == null or ORT011[0].rawValue == null or STRAS1[0].rawValue == null) then
xfa.host.messageBox("Please supply at least Street Name, District/Suburb, City and Postal Code. Full address must be supplied for changes.", "Residential Address", 3, 1)
endif
elseif (HSNMR1[1].rawValue <> null) then
if (ORT021[1].rawValue == null or PSTLZ1[0].rawValue == null or ORT011[0].rawValue == null or STRAS1[0].rawValue == null) then
xfa.host.messageBox("Please supply at least Street Name, District/Suburb, City and Postal Code. Full address must be supplied for changes.", "Residential Address", 3, 1)
endif
elseif (ORT011[0].rawValue <> null) then
if (ORT021[1].rawValue == null or PSTLZ1[0].rawValue == null or ORT011[0].rawValue == null or STRAS1[0].rawValue == null) then
xfa.host.messageBox("Please supply at least Street Name, District/Suburb, City and Postal Code. Full address must be supplied for changes.", "Residential Address", 3, 1)
endif
elseif (ORT021[1].rawValue <> null) then
if (ORT021[1].rawValue == null or PSTLZ1[0].rawValue == null or ORT011[0].rawValue == null or STRAS1[0].rawValue == null) then
xfa.host.messageBox("Please supply at least Street Name, District/Suburb, City and Postal Code. Full address must be supplied for changes.", "Residential Address", 3, 1)
endif
elseif (PSTLZ1[0].rawValue <> null) then
if (ORT021[1].rawValue == null or PSTLZ1[0].rawValue == null or ORT011[0].rawValue == null or STRAS1[0].rawValue == null) then
xfa.host.messageBox("Please supply at least Street Name, District/Suburb, City and Postal Code. Full address must be supplied for changes.", "Residential Address", 3, 1)
endif
endif
if (POSTA5[0].rawValue <> null)then
if ((LOCAT5[1].rawValue == null and STRAS5[1].rawValue == null) or ORT025[0].rawValue == null or ORT015[1].rawValue == null or PSTLZ5[1].rawValue == null) then
xfa.host.messageBox("Please supply a minimum of ( PO Box/Complex or Street Name ), District/Suburb, City and Postal Code. Only complete Mailing Address if different to Residential Address. Full address must be supplied for changes.", "Mailing Address", 3, 1)
endif
elseif (LOCAT5[1].rawValue <> null)then
if ((LOCAT5[1].rawValue == null and STRAS5[1].rawValue == null) or ORT025[0].rawValue == null or ORT015[1].rawValue == null or PSTLZ5[1].rawValue == null) then
xfa.host.messageBox("Please supply a minimum of ( PO Box/Complex or Street Name ), District/Suburb, City and Postal Code. Only complete Mailing Address if different to Residential Address. Full address must be supplied for changes.", "Mailing Address", 3, 1)
endif
elseif (HSNMR5[0].rawValue <> null)then
if ((LOCAT5[1].rawValue == null and STRAS5[1].rawValue == null) or ORT025[0].rawValue == null or ORT015[1].rawValue == null or PSTLZ5[1].rawValue == null) then
xfa.host.messageBox("Please supply a minimum of ( PO Box/Complex or Street Name ), District/Suburb, City and Postal Code. Only complete Mailing Address if different to Residential Address. Full address must be supplied for changes.", "Mailing Address", 3, 1)
endif
elseif (STRAS5[1].rawValue <> null)then
if ((LOCAT5[1].rawValue == null and STRAS5[1].rawValue == null) or ORT025[0].rawValue == null or ORT015[1].rawValue == null or PSTLZ5[1].rawValue == null) then
xfa.host.messageBox("Please supply a minimum of ( PO Box/Complex or Street Name ), District/Suburb, City and Postal Code. Only complete Mailing Address if different to Residential Address. Full address must be supplied for changes.", "Mailing Address", 3, 1)
endif
elseif (ORT025[0].rawValue <> null)then
if ((LOCAT5[1].rawValue == null and STRAS5[1].rawValue == null) or ORT025[0].rawValue == null or ORT015[1].rawValue == null or PSTLZ5[1].rawValue == null) then
xfa.host.messageBox("Please supply a minimum of ( PO Box/Complex or Street Name ), District/Suburb, City and Postal Code. Only complete Mailing Address if different to Residential Address. Full address must be supplied for changes.", "Mailing Address", 3, 1)
endif
elseif (ORT015[1].rawValue <> null)then
if ((LOCAT5[1].rawValue == null and STRAS5[1].rawValue == null) or ORT025[0].rawValue == null or ORT015[1].rawValue == null or PSTLZ5[1].rawValue == null) then
xfa.host.messageBox("Please supply a minimum of ( PO Box/Complex or Street Name ), District/Suburb, City and Postal Code. Only complete Mailing Address if different to Residential Address. Full address must be supplied for changes.", "Mailing Address", 3, 1)
endif
elseif (PSTLZ5[1].rawValue <> null)then
if ((LOCAT5[1].rawValue == null and STRAS5[1].rawValue == null) or ORT025[0].rawValue == null or ORT015[1].rawValue == null or PSTLZ5[1].rawValue == null) then
xfa.host.messageBox("Please supply a minimum of ( PO Box/Complex or Street Name ), District/Suburb, City and Postal Code. Only complete Mailing Address if different to Residential Address. Full address must be supplied for changes.", "Mailing Address", 3, 1)
endif
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment