Based on value of Weight, Rate , CNF & AWB it will change the value of Freight, TTLCNF anfd TTLFright.
Freight= Weight*Rate;
TTLCNF = Weight*CNF;
TTLFright= Freight+TTLCNF +AWB;
@Html.TextBoxFor(model => model.Weight, new { onChange="return GetWight(this);"})
@Html.TextBoxFor(model => model.Rate, new { onChange="return GetWight(this);"})/Kg
@Html.TextBoxFor(model => model.Freight, new {disabled = "disabled" , @readonly = "readonly" ,onChange="return GetTTLFright(this);"})
@Html.TextBoxFor(model => model.CNFPK, new { onChange="return GetCNFPK(this);"})
@Html.TextBoxFor(model => model.TTLCNF, new {disabled = "disabled" , @readonly = "readonly",onChange="return GetTTLFright(this);" })
@Html.TextBoxFor(model => model.AWB, new { onChange="return GetTTLFright(this);"})
and script
<script>
function GetWight(ctr) {
var x = $("#Weight").val();
var y = $("#Rate").val();
var total = x * y;
$("#Freight").val(total);
}
function GetCNFPK(ctr) {
var p = $("#Weight").val();
var q = $("#CNFPK").val();
var totalCNFPK = p * q;
$("#TTLCNF").val(totalCNFPK);
}
function GetTTLFright(ctr) {
var p = $("#Freight").val();
var q = $("#TTLCNF").val();
var s = $("#AWB").val();
var totalTTLFright = parseFloat(p) + parseFloat(q) + parseFloat(s);
$("#TTLFREIGHT").val(totalTTLFright);
}
</script>
Comments
Post a Comment