<form action="" method="post" id="frm" onsubmit="return checkForm()">
<div id="mydiv" style="display:block;">
<div id="mydiv-block">
<input type="radio" name="weight" id="ves1" value="10" class="test">
<label for="ves1">от 1кг до 3кг</label>
</div>
<div id="mydiv-block">
<input type="radio" name="weight" id="ves2" value="100" class="test">
<label for="ves2">от 3кг до 5кг</label>
</div>
<div id="mydiv-block">
<input type="radio" name="weight" id="ves3" value="1000" class="test">
<label for="ves3">от 5кг до 15кг</label>
</div>
</div>
<label for="price" class="name-mail-php">Стоимость товара, рос. руб.:<span>*</span></label><br>
<input type="number" id="price" name="price" maxlength="300" required><br>
<label for="pricedeliv" class="name-mail-php">Стоимость комиссии за доставку в РБ, рос. руб.:</label><br>
<input type="number" id="pricedeliv" name="pricedeliv" maxlength="300" required readonly><br><span2>10% от стоимости заказа</span2>
<div id="maineu-dost">
Стоимость доставки:<input type="number" id="dostavkas" value="0" readonly>руб
</div>
<input type="number" id="itog" name="789" maxlength="300" readonly><br>
</form>
<script>
(function(){
var form = document.forms.frm;
form.onchange = form.oninput = calcTotal;
function calcTotal() {
var weight = 0;
for ( var i = 0; i < form.weight.length; i++) {
weight += form.weight[i].checked * +form.weight[i].value;
}
var price = +form.price.value;
var deliveryPrice = +form.pricedeliv.value;
var huyPoimiChe = +form.dostavkas.value;
form.pricedeliv.value = 0.1 * price;
form.itog.value = weight + price + deliveryPrice + huyPoimiChe;
form.dostavkas.value = weight;
}
})();
</script>