ASP.NET MVC input value is not passed to controller action when value changed via jquery

631 Views Asked by At

I have a DevExpress SpinEdit amount field:

SpinEdit Field

 @Html.DevExpress().SpinEditFor(model => model.Tare, settings =>
                                {
                                    settings.Width = 153;
                                    settings.Properties.DisplayFormatString = @"0.0,0";
                                }).GetHtml()

When I change the value manually the value is passed correctly to the controller.

Model Value When Manually

But when I change the value via jquery it is displayed correctly but is not passed to the controller.

var gross = parseFloat($('#Brutto_Raw').val().replace(',', '.'));
var net = parseFloat($('#Amount_Raw').val().replace(',', '.'));
var tare = gross - net;
$('#Tare_I').val(parseFloat(tare).toPrecision(12));    
$('#Tare_Raw').val(parseFloat(tare).toPrecision(12));

Display Value Changed Via Jquery

Model Value When Changed Via Jquery

0

There are 0 best solutions below