Having Javascript issues for custom calculation (unchecked Checkboxes exporting value)
So right now, I'm trying to create a fillable pdf form in Adobe Acrobat Pro 2017 for the character sheet of a tabletop game so it automatically calculates the various stats. The problem I'm having is that I can't get a checkbox to export the value "Off" when it's unchecked like it's supposed to. Either that or my Javascript is garbage because I don't get Javascript at all.
What I want to happen is, if the checkbox is checked AND the value in textbox called "Ranks" is 1 or greater, then the text box called "Total" is equal to the sum of 3 + ranks + other boxes. Otherwise, if the checkbox is unchecked, regardless of the value of ranks, then the total should just be the ranks and other boxes.
Right now, the value of the total box is calculating as if the checkbox were always checked
Here's the current script as is for one of the total boxes:
var skill = +getField("Skill Check").value; //this is the checkbox
var ability = +getField ("Abl Modifier").value;
var rank = +getField("Ranks 1").value;
var misc = +getField("Misc Mod. 1").value;
if (skill="Yes" && rank>0) event.value = Math.floor(3+ability+rank+misc);
else if (skill="Off") event.value = Math.floor(ability+rank+misc)
