2 Replies Latest reply on Jan 10, 2015 5:48 PM by Alyksandrei

    allow user to input text or use auto-calculated value

    Alyksandrei

      I have a form I'm trying to add auto-calculations to. The problem is that sometimes the default calculation doesn't include all the necessary variables (and I can't add anything to get those variables to include), so it seems that sometimes the user will want to override the default calculation. Is there a way to allow this? I couldn't figure this out, and the only help documentation I could find that mentions this is for related software that I don't have.

        • 1. Re: allow user to input text or use auto-calculated value
          gkaiseril MVP & Adobe Community Professional

          Yes, you write the code that prevents the running the calculation if there is a value in the form field or you use to check mark to control if the field will be user input or auto calculated.

          • 2. Re: Re: allow user to input text or use auto-calculated value
            Alyksandrei Level 1

            Can you explain how to do that? I'm not really all that good at programming and I've never tried something like that before. A code example would be nice ... Here's what I have now, and it does what it's supposed to. Can you show me how to add the capabilities you mention?

             

            //check bonus = stat bonus + applicable proficiency bonus
            var profUse = this.getField("SklAcrProf").value;
            var stat = Number(this.getField("DEX1").value);
            var profVal = Number(this.getField("Proficiency Bonus").value);
            var check = Number('-2');
            if (profUse != "Off"){
                check = stat + profVal;
            }
            else{
                check = stat;
            }
            event.value = check;