Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Allowing user input to override autocalculations

$
0
0

How do I get a form field to allow user input that overrides the autocalculation? I'm particularly looking for a code snippet I can use and/or modify. The code I have now is included below.

 

 

//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;


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>