Need Help creating a form calculation involving checkboxes
- November 6, 2022
- 3 replies
- 1983 views
Ok, so here's what I have.. and I'm clueless as to what is going on because I can't figure it out. Using other examples on the forums I have the following code:
var oFldSel = this.getField("Weapon1.Proficiency.Bonus1");
if(oFldSel)
{
switch(oFldSel.value)
{
case "Trained":
event.value = 2;
break;
case "Expert":
event.value = 4;
break;
case "Master":
event.value = 6;
break;
case "Legend":
event.value = 8;
break;
default:
event.value = 0;
break;
}
}
Ok, so when radio button 1 (trained) is selected it changes the value of the field to 2, likewise the others change appropriately. However, when I get to the final calculation which calculates the entire weapon bonus using strength modifier (almost never changes), Proficiency Bonus (changes per level of character and per level of proficiency) and an item modifier (which could change at any time) it's showing the OLD value of the proficiency bonus. Example: Proficiency Bonus orignally +2 but proficiency level increases to +4, total stays with the +2 value unless changed again then it takes the +4 value.
I'm including the copy of the character sheet I'm trying to set up.. Can anyone help me please? It's giving me a headache and frustrating as f***!!