将 xval 与包含句点的字段一起使用

发布于 2024-08-30 08:06:59 字数 482 浏览 2 评论 0原文

我已经成功使用 xVal 一段时间了,但今天晚上遇到了一个问题,即无法验证包含句点的字段(客户端或服务器端)。我正在使用 ASP.NET MVC2,并且在模型绑定到列表的情况下需要使用句点语法。在下面的示例中,为了简单起见,我使用文本框:

xVal.AttachValidator(null, { "Fields": [{ "FieldName": "entry[622592].Value", "FieldRules": [{ "RuleName": "Required", "RuleParameters": {}}]}] }, {})


<input type="text" class="text" name="entry[622592].Value"/> 

如果我将“entry[622592].Value”的两个实例替换为“test”之类的小东西,那么验证会成功,但如果我这样保留它验证似乎从未启动...

有人遇到过这个问题吗? 提前致谢!

I have been using xVal with success for a while but this evening ran into an issue where a field containing a period would not be validated (client or server-side). I am using ASP.NET MVC2 and need to use the period syntax in cases where I am model binding to a list. In the below example I am using a textbox for the sake of simplicity:

xVal.AttachValidator(null, { "Fields": [{ "FieldName": "entry[622592].Value", "FieldRules": [{ "RuleName": "Required", "RuleParameters": {}}]}] }, {})


<input type="text" class="text" name="entry[622592].Value"/> 

If I replace both instances of "entry[622592].Value" to something trivial like "test" then the validation works successfully, but if i leave it this way the validation never appears to fire...

Has anyone run into this issue?
Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文