A
A
Arthur2017-03-01 11:39:30
ASP.NET
Arthur, 2017-03-01 11:39:30

How to beat jQuery Validation?

Hello.
There is a Location entity with the following parameters:

[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:0,0000000000}")]
public string Lng { get; set; }
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:0,0000000000}")]
public string Lat { get; set; }

Concerning that string - zadolbalsya with conversions of points and commas.
There is a view in which I display the parameters in this way:
@Html.EditorFor(model => model.Lng, new { htmlAttributes = new { @class = "form-control" } } )
@Html.EditorFor(model => model.Lat, new { htmlAttributes = new { @class = "form-control" } })

Input value, for example: 48.22356 , i.e. there are numbers after the decimal point.
Initially outputs input with a normal value, but after jquery validation is initialized, this monster rounds this number up and outputs 49.00000. I have already tried so many things, I have reviewed all the Google pages on this topic, I would like to hear from someone who has come across this ..

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question