'Run Adobe PDF script when document is saved

I am attempting to place the script below in Document Actions under "Document Did Save". I'm not sure how to complete the if statements. I would like the script to run if the client answers yes to any of the 8 questions.

var MonTitre = "Title";
var MonAlerte = 'You answered "Yes" to 1 or more questions on this form. Would you like to email it to us now?\n \nClick "Yes" to create an email draft with the form.';
var cToAddr = "[email protected]";
var cCCAddr = "";
var cBody = "Please, review……\n”;
var one = this.getField("cd.one");
var two = this.getField("cd.two");
var three = this.getField("cd.three");
var four = this.getField("cd.four");
var five = this.getField("cd.five");
var six = this.getField("cd.six");
var seven = this.getField("cd.seven");
var eight = this.getField("cd.eight");


if (one = "Yes" || two = "Yes" || three = "Yes" || four = "Yes" || five = "Yes" || six = "Yes" || seven = "Yes" || eight = "Yes"){

if(app.alert({cMsg: MonAlerte, nIcon: 1, cTitle: MonTitre, nType: 2}) == 4){
this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: "Review", cMsg: cBody});}


Solution 1:[1]

I think you are missing .value in your getField commands:

 var one = this.getField("cd.one").value ;

easy to forget!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Henry Ecker