9 Replies Latest reply on Jan 15, 2018 12:30 PM by Gelat1n0usCube

    Dropdown choice translation into values

    Gelat1n0usCube

      Hello, I have created a character sheet for a game and I am stuck trying to translate drop down menu choices into numerical values to work with. The point is that a character is supposed to gain different bonuses according to the race chosen (as shown in the human/elf example below). Now I have the dropdown menu "Races" and I would like to have all the "racialmodXXX" added to the corresponding text fields (for example the "Agilitytotal" text field should be computed by adding the entered value in the "Agility" text field + "racialmodagi".)

       

      This is what I have entered into the validation box of the "Races" dropdown menu:

       

      var racetype = this.getField('Races');

      var racialmodbody = '0';

      var racialmodagi = '0';

      var racialmodreac = '0';

      var racialmodstr = '0';

      var racialmodwill = '0';

      var racialmodlog = '0';

      var racialmodint = '0';

      var racialmodcha = '0';

      var racialmodedge = '0';

      var racialmodmag = '0';

       

      if (racetype.value == 'Human')

        {

      racialmodbody.value='0';

      racialmodagi.value='0';

      racialmodreac.value='0';

      racialmodstr.value='0';

      racialmodwill.value='0';

      racialmodlog.value='0';

      racialmodint.value='0';

      racialmodcha.value='0';

      racialmodedge.value='1';

      racialmodmag.value='0';

      }

       

       

      if (racetype.value == 'Elf')

        {

      racialmodbody.value='0';

      racialmodagi.value='1';

      racialmodreac.value='0';

      racialmodstr.value='0';

      racialmodwill.value='0';

      racialmodlog.value='0';

      racialmodint.value='0';

      racialmodcha.value='2';

      racialmodedge.value='0';

      racialmodmag.value='0';

      }

       

      The text field "Agilitytotal" is supposed to report "(Agility) + (racialmodagi)" by calculation but it doesn't. Once I remove (racialmodagi) from the calculation window, it works properly.

       

      Sorry for the wall of text but maybe some of you have an idea how to solve this.

       

      Thanks a lot in advance!