Form radio calculator syntax js?

when you select the radio selects 1 value automatically and does not switch
<form name="myform">

<input type="radio" name="tetFIN" onchange="calculatePrice()" id="etetFIN" value="75">75
<input type="radio" name="tetFIN" onchange="calculatePrice()" id="wefNEW" value="40">40

<select name="hddItem" onchange="calculatePrice()" id="hddItem">
 <option value="45">0</option>
 <option value="80">$109</option>
 <option value="118">$150</option>
 <option value="150">$199</option>
 <option value="183">$299</option>
 <option value="215">$299</option>

<select name="networkItem" onchange="calculatePrice()" id="networkItem">
 <option value="0">0</option>
 <option value="109">$109</option>
 <option value="79">$79</option>
 <option value="279">$279</option>

<input type="text" id="PicExtPrice" value> 

the <script>

function calculatePrice(myform){

 //Get selected data 

 var elt = document.getElementById("wefNEW");
var ew = elt.value;

 var elt = document.getElementById("etetFIN");
var ew = elt.value;

 var elt = document.getElementById("hddItem");
 var hdd = elt.options[elt.selectedIndex].value;

 var elt = document.getElementById("networkItem");
 var network = elt.options[elt.selectedIndex].value;

 //convert data to integers
 ew = parseInt(ew);

 hdd = parseInt(hdd);
 network = parseInt(network);

 //calculate total value 
 var total = ew+hdd+network; 

 //print value to PicExtPrice 


July 9th 19 at 13:13

Find more questions by tags JavaScript