2 Replies Latest reply on Jun 8, 2017 7:00 AM by cynthiadorfsmith

# Conditional with checkbox

Any help would be amazing, I've been looking all day for a solution and can figure out each separate piece, but can't get them to come together.

I'm trying to create a JavaScript that will return a 0 if a checkbox is checked and if unchecked will run the script below.

var n = this.getField("textbox").value;

if (n >0 && n <= 1.00) event.value = .50;

else if (n > 1.00 && n <= 1.50) event.value = .75;

else if (n > 1.50 && n <= 2.00) event.value = 1.00;

else if (n > 2.00 && n <= 2.50) event.value = 1.25;

else if (n > 2.50 && n <= 3.00) event.value = 1.50;

else if (n > 3.00 && n <= 3.50) event.value = 1.75;

else if (n > 3.50 && n <= 4.00) event.value = 2.00;

else if (n > 4.00 && n <= 4.50) event.value = 2.25;

else if (n > 4.50 && n <= 5.00) event.value = 2.50;

else if (n > 5.00 && n <= 5.50) event.value = 2.75;

else if (n > 5.50 && n <= 6.00) event.value = 3.00;

else if (n > 6.00 && n <= 6.50) event.value = 3.25;

else if (n > 6.50 && n <= 7.00) event.value = 3.50;

else if (n > 7.00 && n <= 7.50) event.value = 3.75;

else if (n > 7.50 && n <= 8.00) event.value = 4.00;

else event.value = "0.00"

• ###### 1. Re: Conditional with checkbox

```if (this.getField("Checkbox1").value!="Off") event.value = 0;