简体   繁体   中英

Adobe Livecycle Designer Javascript Calculation

My if statement below is not working on a numeric field that is set to calculate in Adobe Livecycle Designer and I can't figure it out. All of my field names are accurate and those fields are set as numeric. It keeps showing a value of 0.

Any help or guidance is appreciated.

if (RadioButtonList.btn2.selectedIndex == 0 || RadioButtonList.btn4.selectedIndex == 0) {
this.rawValue = ((Table3.Row1.Cell3 * NumericField1) / Table3.Row1.Cell4);
} else if (RadioButtonList.btn1.selectedIndex == 0 || RadioButtonList.btn3.selectedIndex == 0) {
if (DropDownList1.rawValue === "Concierge") {
    this.rawValue = ((Table3.Row1.Cell3 * NumericField1) * 0.06);
    }
if (DropDownList1.rawValue != "Concierge" && DropDownList1.rawValue != "" ) {
    this.rawValue = ((Table3.Row1.Cell3 * NumericField1) * 0.04) / Table3.Row1.Cell4;
    }
} else {this.rawValue = 0;}

If the problem still persists I would suggest you do following: Select RadioButtonList and in the Object palette -> Binding tab verify values for each radio button you have. Then rewrite your code to look it similar to this:

if (RadioButtonList.rawValue == 2 || RadioButtonList.rawValue == 4) {
    this.rawValue = ((Table3.Row1.Cell3 * NumericField1) / Table3.Row1.Cell4);
} 
else if (RadioButtonList.rawValue == 1 || RadioButtonList.rawValue == 3) {
    if (DropDownList1.rawValue === "Concierge") {
        this.rawValue = ((Table3.Row1.Cell3 * NumericField1) * 0.06);
    }
    if (DropDownList1.rawValue != "Concierge" && DropDownList1.rawValue != "" ) {
        this.rawValue = ((Table3.Row1.Cell3 * NumericField1) * 0.04) / Table3.Row1.Cell4;
    }
} 
else {
    this.rawValue = 0;
}

As a value for each button I choose a number of a button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM