Javascript correctly hides fields on screen but not when printed
I'm using a product that pulls field data in from XML when processing PDF documents for a loan origination system. I have some code that I am trying to use to hide a particular field when our loan origination system passes the value "$0.00". I also have some code that I am trying to hide a date field next to a co-borrower 1 and co-borrower 2 fields.
When processing the PDF's through our system they look correct on screen. If there isn't a co-borrower 1, there is not a date in the date field next to the name. Same deal with co-borrower 2 and its date field. When there is no loan insurance, the field is hidden. When there is loan insurance, the amount is in the proper field (example $917.17).
However when we go to print the flattened PDF's when processing is completed, no matter what we see a value in the loan insurance field, even if it is $0.00. Also we see the date next to each co-borrower's name.
Why doesn't the javascript code to hide a field work when printed? Why is it only working when on screen? This should be a simple fix. Our product vendor wants to bill us to correct this. Surely I am VERY close to fixing this without involving "professional support"?
The code is as follows
var LN_INS_OPT_PREM_AMT_P = this.getField ("LN_INS_OPT_PREM_AMT");
var C_NAME_P = this.getField ("C_NAME");
var CS1_NAME_P = this.getField ("CS1_NAME");
if (LN_INS_OPT_PREM_AMT_P.value == "$0.00")
{
getField("LN_INS_OPT_PREM_AMT").display = display.hidden;
}
if (C_NAME_P.value == "")
{
getField("LN_EFFECTIVE_DT_D1").display = display.hidden;
}
if (CS1_NAME_P.value == "")
{
getField("LN_EFFECTIVE_DT_D2").display = display.hidden;
}
Images: When Processing note the fields are correctly hidden.
After processing when you go to print the flattened PDF's, the hidden fields are revealed.
