First of all i suggest you clean up the code a bit. Use this for
example.--------------------------------------------------------------------------------------------------------------------------------var
strSelectedText = xfa.event.newText;customprint.presence =
(strSelectedText == "CustomPrint") ? "visible" :
"hidden";preprint.presence = (strSelectedText == "PrePrint") ? "visible"
: "hidden";frontpagenote.presence = (strSelectedText == "FrontPageNote")
? "visible" : "hidden";weprint.presence =...