I have a rather complex checkbox issue, I've never wrote JavaScript before so can really use help
- January 23, 2021
- 2 replies
- 1769 views
I have a a fillable pdf that has 3 groups of six checkboxes
The sheet is for bidding projects with minority contractors
African American, Asian American, Native America, Woman, Hispanic, Disabled
I need to calculate the sums based on a checkbox along the appropriate catergory
I started putting this together but not sure have to apply it to the Totals at the bottom...
var checkbox1Value = this.getField("AfricanAmerican_1");
if (checkbox1Value.isBoxChecked(0))
var checkbox1Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox1Value = 0
var checkbox2Value = this.getField("AfricanAmerican_2");
if (checkbox2Value.isBoxChecked(0))
var checkbox2Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox2Value = 0
var checkbox3Value = this.getField("AfricanAmerican_3");
if (checkbox3Value.isBoxChecked(0))
var checkbox3Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox3Value = 0
var checkbox4Value = this.getField("AsianAmerican_1");
if (checkbox4Value.isBoxChecked(0))
var checkbox4Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox4Value = 0
var checkbox5Value = this.getField("AsianAmerican_2");
if (checkbox5Value.isBoxChecked(0))
var checkbox5Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox5Value = 0
var checkbox6Value = this.getField("AsianAmerican_3");
if (checkbox6Value.isBoxChecked(0))
var checkbox6Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox6Value = 0
var checkbox7Value = this.getField("NativeAmerican_1");
if (checkbox7Value.isBoxChecked(0))
var checkbox7Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox7Value = 0
var checkbox8Value = this.getField("NativeAmerican_2");
if (checkbox8Value.isBoxChecked(0))
var checkbox8Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox8Value = 0
var checkbox9Value = this.getField("NativeAmerican_3");
if (checkbox9Value.isBoxChecked(0))
var checkbox9Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox9Value = 0
var checkbox10Value = this.getField("Women_1");
if (checkbox10Value.isBoxChecked(0))
var checkbox10Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox10Value = 0
var checkbox11Value = this.getField("Women_2");
if (checkbox11Value.isBoxChecked(0))
var checkbox11Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox11Value = 0
var checkbox12Value = this.getField("Women_3");
if (checkbox12Value.isBoxChecked(0))
var checkbox12Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox12Value = 0
var checkbox13Value = this.getField("Hispanic_1");
if (checkbox13Value.isBoxChecked(0))
var checkbox13Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox13Value = 0
var checkbox14Value = this.getField("Hispanic_2");
if (checkbox14Value.isBoxChecked(0))
var checkbox14Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox14Value = 0
var checkbox15Value = this.getField("Hispanic_3");
if (checkbox15Value.isBoxChecked(0))
var checkbox15Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox15Value = 0
var checkbox16Value = this.getField("Disabled_1");
if (checkbox16Value.isBoxChecked(0))
var checkbox16Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox16Value = 0
var checkbox17Value = this.getField("Disabled_2");
if (checkbox17Value.isBoxChecked(0))
var checkbox17Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox17Value = 0
var checkbox18Value = this.getField("Disabled_3");
if (checkbox18Value.isBoxChecked(0))
var checkbox18Value = PartAmt1+ PartAmt2+ PartAmt3+ PartAmt4+ PartAmt5+ PartAmt6+ PartAmt7+ PartAmt8+ PartAmt9
else
var checkbox18Value =