<div>
<label>
<span>current weight per bag</span>
<input type="text" name="cwpbags" id="nos" onKeyUp="sum1();" autofocus>
<script> function sum1() {
var txtFirstNumberValue = document.getElementById('nos').value;
var txtthirdNumberValue = document.getElementById('bag').value;
var txtthirddNumberValue = document.getElementById('loading').value;
var initial =1000;
var result = parseFloat(txtFirstNumberValue) * parseFloat(txtthirdNumberValue) * parseFloat(txtthirddNumberValue) ;
var div = parseFloat(txtFirstNumberValue) * parseFloat(txtthirdNumberValue) / initial;
if (!isNaN(result)) {
document.getElementById('amount').value = result;
};
if (!isNaN(div)) {
document.getElementById('freight').value = div;
};
}</script>
</label>
<label>
<span>current No of bag</span>
<input type="text" name="cnofbags" id="bag" onkeyup="sum1();" autofocus>
</label>
</div>
<div>
<label>
<span>loading</span>
<input type="text" name="loading" id="loading" onKeyUp="sum1();" autofocus>
</label>
</div><div>
<label>
<span>amount</span>
<input type="text" name="amount" id="amount" required autofocus>
</label>
</div>
<div>
<label>
<span>HOW many tons</span>
<input type="text" name="loading" id="freight" autofocus>
</label>
</div>
DEMO:
<label>
<span>current weight per bag</span>
<input type="text" name="cwpbags" id="nos" onKeyUp="sum1();" autofocus>
<script> function sum1() {
var txtFirstNumberValue = document.getElementById('nos').value;
var txtthirdNumberValue = document.getElementById('bag').value;
var txtthirddNumberValue = document.getElementById('loading').value;
var initial =1000;
var result = parseFloat(txtFirstNumberValue) * parseFloat(txtthirdNumberValue) * parseFloat(txtthirddNumberValue) ;
var div = parseFloat(txtFirstNumberValue) * parseFloat(txtthirdNumberValue) / initial;
if (!isNaN(result)) {
document.getElementById('amount').value = result;
};
if (!isNaN(div)) {
document.getElementById('freight').value = div;
};
}</script>
</label>
<label>
<span>current No of bag</span>
<input type="text" name="cnofbags" id="bag" onkeyup="sum1();" autofocus>
</label>
</div>
<div>
<label>
<span>loading</span>
<input type="text" name="loading" id="loading" onKeyUp="sum1();" autofocus>
</label>
</div><div>
<label>
<span>amount</span>
<input type="text" name="amount" id="amount" required autofocus>
</label>
</div>
<div>
<label>
<span>HOW many tons</span>
<input type="text" name="loading" id="freight" autofocus>
</label>
</div>
No comments:
Post a Comment