将 xval 与包含句点的字段一起使用
我已经成功使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论