title: Calculation based on radio button selection PDF FORM JS
body: <p>I am trying to have the "values" of radio buttons change, dependent on the selection of other radio buttons.  (This is for a PDF Form in Adobe Pro (not designer)</p>
  
  <p>The code which I have tried (inserted on the SingleTotal field) is as follows:
  however it is not calculating:</p>
  
  <pre><code>// Custom Calculate script
  (function(){
  
  
  //declare vars
  
  
  var oFldSec1 = this.getField("A");
  var oFldSec2 = this.getField("B");
  var oFldSec3 = this.getField("C");
  var oFldSel = this.getField("Options Single");
  var oFldSub = this.getField("SingleTotal");
  
  if(oFldSec1.checked) {
  
       switch(oFldSel.value)
     {
        case "boy":
          event.value = 30;
          break;
        case "girl":
          event.value = 35;
          break;
          default:
          event.value = 0;
          break;
     }
  }
  else if(oFldSec2.checked) {
  
  switch(oFldSel.value)
     {
        case "boy":
          event.value = 40;
          break;
        case "girl":
          event.value = 45;
          break;
          default:
          event.value = 0;
          break;
     }
  }
  
  })
  </code></pre>
  
  <p>Any help will be greatly appreciated.  Thank you :)</p>