Numerical field error MVC Asp.Net

Asked

Viewed 82 times

0

People I’m having trouble in Asp.NET MVC when I use numerical field I’m having error. Razor is like this

@Html.EditorFor(model => model.AliqIpi, new
{
    htmlAttributes = new {
        @class = "form-control", @style = "text-align: right;", @type = "number", @min = "0", @step = "0.01", @value = "0"
    }
})
@Html.ValidationMessageFor(model => model.AliqIpi, "", new { @class = "text-danger" })

and when editing the record when I move the values to the grid does not show the numerical values and this error

The specified value "0,00" is not a Valid number. The value must match to the following regular Expression: -? ( d+| d+. d+|. d+)([ee][-+]? d+)?

Someone’s been through this?

  • 1

    type number only accepts numbers, if you are trying to add swap characters for @type = "tel"

  • is number even, only keeps giving this error.

  • So, , It’s not number, change the type to tel

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.