Select/deselect checkbox if text is entered/deleted from multiple text fields
I'm creating a form in Acrobat DC. I have a checkbox named AN_PA_CB; its export value is "Proximate Analysis" (this cannot be changed because of other code in my form). I have three text fields named AN_PA_CP_TB, AN_PA_CF_TB, and AN_PA_A_TB. I need checkbox AN_PA_CB to check if text is entered in one or more of the three text fields AN_PA_CP_TB, AN_PA_CF_TB, and AN_PA_A_TB. I also need the checkbox to uncheck if text is deleted from all three text fields; however, the checkbox must stay checked if text remains in one or more of the fields.
I tried entering the code below in the custom format of each textbox:
this.getField("AN_PA_CB").checkThisBox(0,!/^\s*$/.test(event.value));
This checks/unchecks the checkbox successfully when text is added/deleted from a text field; however, this code considers each text field individually and unchecks the checkbox whenever text is deleted from any text field, even if the other two still contain text.
Is there a way for checkbox AN_PA_CB to check/uncheck dynamically when text is entered/delected from the three text fields? So all three text fields blank = checkbox unchecked, one or more text fields contains text = checkbox checked.
