Skip to content

Problem validators langage use when there is a decimal field in a form #42014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Adeniel opened this issue Jun 3, 2022 · 1 comment
Closed
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-mvc-razor-views Features related to the Razor view engine for Razor pages and MVC views ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@Adeniel
Copy link

Adeniel commented Jun 3, 2022

Describe the bug

With a model that contains a decimal property, this doesn't work with a locale that uses a decimal comma:

<input asp-for="Number">
<input asp-for="Number" type="number">

Code:
I am used a modal for display my form and a ViewModel:

class ViewModel 
{
           [StringLength(56)]
           public string Speciality { get; set; }

           [StringLength(128)]
           public string StructureLinked { get; set; }

           [Required]
           [AbpRadioButton(Inline = true)]
           public RateType RateSelected { get; set; }

           [HiddenInput]
           public decimal RateGeneral { get; set; }

           public decimal RateSpecific { get; set; }
}

The first issue is that the rest of the form return french validator langage as expected, but for all the properties which use decimal the validator is in English.
The second issues is that we give a data without comma it's send and receive correctly. But if we respect the English format as 9.8 we receive 0.

I tried to force the loading of the file jqueryvalidator/message_fr.js or some differents fix find on web without success

@javiercn javiercn added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-mvc-razor-views Features related to the Razor view engine for Razor pages and MVC views labels Jun 3, 2022
@javiercn
Copy link
Member

javiercn commented Jun 6, 2022

@Adeniel thanks for contacting us.

We believe this is a duplicate of #6566

@javiercn javiercn closed this as completed Jun 6, 2022
@javiercn javiercn added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Jun 6, 2022
@ghost ghost added the Status: Resolved label Jun 6, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-mvc-razor-views Features related to the Razor view engine for Razor pages and MVC views ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

2 participants