I have the following model. It was generated from the database with entity. The two fields can be null.
public partial class Items
{
public int id { get; set; }
public Nullable<decimal> largo { get; set; }
public Nullable<decimal> ancho { get; set; }
}
In my view I'm using JqueryValidation.
<div class="form-group">
@Html.LabelFor(m => m.largo, new { @class = "col-sm-2 control-label" })
<div class="col-sm-10">
@Html.TextBoxFor(m => m.largo, new { @class = "form-control mul" })
@Html.ValidationMessageFor(m => m.largo)
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.ancho, new { @class = "col-sm-2 control-label" })
<div class="col-sm-10">
@Html.TextBoxFor(m => m.ancho, new { @class = "form-control mul" })
@Html.ValidationMessageFor(m => m.ancho)
</div>
</div>
I try to send the form with nothing in the inputs, but it does not leave me for the validation of jquery (I suppose) ...
Is there any way to send the null fields?