Im trying to display the total amount in MVC from @Html.TextboxFor()s to @Html.DisplayFor() without total buttons or anything. Just like in winform textChange but I don't have any idea how to do it.
@Html.TextBoxFor(s => s.num1)
@Html.TextBoxFor(s => s.num2)
while changing the amount in textboxes, the displayfor will automatically diplays the total
I added this based on Linoy's answer but the .text doesn't seem to display the result.
$('.getNum1').blur(function () {
var val1 = $(this).val();
var val2 = $('.getNum2').val();
$('.gettotal').text(parseInt(val1) + parseInt(val2));
});