Adobe Livecycle Designer Javascript Calculation

643 views Asked by At

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;}
1

There are 1 answers

0
ph6 On

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.