I'm working with a C# MVC5 application. I'm having a problem using jqueryval while my application culture is es-CL. I have this attribute in my class model
[Display(Name = "Coeficiente B")]
[RegularExpression(@"^([-]?[\d]+(,[\d]+)?)?$", ErrorMessage = "error")]
[DisplayFormat(DataFormatString = "{0:#.##}")]
public float? coefB { get; set; }
and this code in the view for the model
@Html.EditorFor(model => model.Sensores_Piezometros.coefA)
the problem is that jqueryval is invalidating my data in the client side because it doesn't recognize the comma as part of the number. so i get this error message El campo Coeficiente B debe ser un número
I think that changing or overiding the jqueryval method to put a replace(".",",")
is not the best option because i need my application to work with any culture, not es-CL only and cultures like en-US should not allow comma as decimal separator.
Edit: if i can disable the default jqueryval validation for a single atribute(coefB) it would be ok too because i'm already validating with my own regex.