Need help in a form to calculate the value of a field based on the visibility of radio buttons
- January 1, 2025
- 返信数 1.
- 677 ビュー
I'm creating a sheet for a game. I have a list of skills with 3 radio buttons stacked on top of each other next to each skill. The idea is that if you do not have that skill, the "Blank" radio button is visible. If you have partial skill in it, the "Partial" button (which is a half circle image) is visible, and if you are fully skilled, the "Skilled" button is visible (full circle image). When one is visible, the other two are hidden. I am using Run Javascript on Mouse Up as the action for each button to hide/show each one. That script is very simple and looks like this:
this.getField("PartialSkillLift").display = display.visible;
this.getField("SkilledLift").display = display.hidden ;
this.getField("BlankLift").display = display.hidden ;
That part is working fine, but what i would like to add to it that i can't seem to get figured out is i would like the skill to show a number or do a calculation based on which button is showing. So, if the Blank button is visible, it just displays the number from a stat bonus (i.e. "StrengthBonus" field). If the Partial button is shown, it does the calculation of "StrengthBonus" + 1). And if the Skilled button is shown, it does the calculation "StrengthBonus + Level + 3" ("Level" is also a field already set up).
I have this in the "Lift" field currently...
