title: Adding value of selected radio button to an equation
body: <p>I am at my wits end. I cannot figure out how to add the value of the radio button to the equation. Can someone give me a clue at least on this??  </p>
  
  <p>If I don't have the radio button function included, this works fine. </p>
  
  <pre><code>&lt;input type="radio" class="InternetCost" name="int" id="no_int" value="0"&gt;None&lt;br&gt;
  &lt;input type="radio" class="InternetCost" name="int" id="ten" value="10"&gt;10&lt;br&gt;
  &lt;input type="radio" class="InternetCost" name="int" id="twenty" value="20"&gt;20&lt;br&gt;
  &lt;input type="radio" class="InternetCost" name="int" id="thirty" value="30"&gt;30&lt;br&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>//Try to select radio button
  var values = document.getElementsByName("int");
  
  function getValue() {
    for(var i = 0; i &lt; values.length; i++) {
    if(values[i].checked == true) {
       selectedValue = values[i].value;
       console.log('value=' + selectedValue);
      }
    }
  }
  
  
  function calculate()
  {
  
  //get selectedValue - this is where I am lost!
  var radioValue = getValue()*1;
  
  //Package 
  var pkgCost = document.getElementById("pkg").value*1;
  
  //Package - Static 
  var equipPkg = document.getElementById("pep").value*1;
  
  //Additional amount
  var addBox = document.getElementById("addtl").value*1;
  
  //Additional Box cost - static
  var totalNum = document.getElementById("add_cost").value*1;
  
  //Service amount
  var dvrSvc = document.getElementById("dvr_svc").value*1;
  
  //Service cost - static
  var dvrCost = document.getElementById("dvr_cost").value*1;
  
  // Sum everything
  var SumAll = pkgCost + equipPkg + (addBox*totalNum) + (Svc*Cost) + radioValue;
  
  // print the total
  document.getElementById("Sum").innerHTML = SumAll.toFixed(2)
  }
  </code></pre>