问题验证器使用langage用时使用ABP模式的形式的小数为小数字段
用包含一个十进制
属性的模型来描述错误
,这与使用小数逗号的语言环境不起作用:代码:
<input asp-for="Number">
<input asp-for="Number" type="number">
代码: 我被使用模式显示我的表单和一个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; }
}
第一个问题是其余表格返回法国验证器langage,但对于使用DECIMAL
的所有属性,验证器都是英语。 第二个问题是,我们在没有逗号的情况下提供了数据,它可以正确发送和接收。但是,如果我们尊重英语格式
为9.8
我们接收0
。
我试图强迫文件的加载jqueryvalidator/message_fr.js或在Web上找到的一些不同的修复程序而没有成功
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这听起来像是这里描述的问题:
mvc/jquery not /a>
解决方案:
您可以覆盖本文中解释的jQuery验证:
oferwollow noreferrer“>
oferwrite jquery jquery jquery verator 您会将其添加到脚本中:
请注意,这仅可以修复客户端中的验证。 也可以在后端采用该辐射。
This sounds like the issue described here:
MVC/JQuery validation does not accept comma as decimal separator
Solution:
You can overwrite the jquery validation as explained in this post:
OverWrite jQuery Validator
To allow comma and dot seperator at the same time you would add this to your script:
Be aware that this only fixes the validation in your client. The valiation might also be adopted in the backend.