26 Replies Latest reply on Nov 1, 2012 2:25 PM by user19875654

    Radio button values change depending on other radio button selections

    user19875654

      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)  The code which I have tried (inserted on the SingleTotal field) is as follows: however it is not calculating:

       

       

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

      })