Skip to main content
New Participant
January 18, 2023
Question

Need button to have 2 actions

  • January 18, 2023
  • 1 reply
  • 494 views

Hey.

I need a button for my D&D charactersheet to have 2 actions.
The actions would be to add several boxes for a total in a final box, or only a base number put in ther final box. It's about having the proficiency bonus box added to the base stat modifier box, with the total placed into a 3rd box.

Example
Checked : Box 1 + Box 2 = Box 3
Unchecked : Box 1 = Box 3

This topic has been closed for replies.

1 reply

Nesa Nurani
Adobe Expert
January 18, 2023

Use this as custom calculation script of "Box 3" and change 'Button'  to your actual radio button name.

var b1 = this.getField("Box 1");
var b2 = this.getField("Box 2");
var check = this.getField("Button").valueAsString;
if(check == "Off")
event.value = b1.value;
else
event.value = Number(b1.value)+Number(b2.value);

 

New Participant
January 18, 2023

Sorry

I meant to say the checkbox, not button.

New Participant
January 18, 2023

Ugh. I forgot something and there isn't an edit button.
OK.
I want the check box to do the following

Checked : Saving throw bonus # = Stat Modifier # + Proficiency Bonus #

Unchecked : Saving throw bonus # = Stat Modifier #

 

I'm just trying to speed up character creation by having the check boxes in the saving throw modifiers box add the proficiency bonus and the stat modifier together in the saving throw bonus box. A+B=C sort of thing. I'm sorry if you're not familiar with Dungeons & Dragons, but the check box in the Saving Throws Modifiers box mean whether or not the character is "proficient". If they are, the proficiency bonus is added to the stat modifier and that's added to a roll made. It was so the box next to the check box had the math done already, so all a player has to do is add that number to the roll.