Using xval with fields containing periods

本秂侑毒 提交于 2019-12-11 06:49:07

问题


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!

来源:https://stackoverflow.com/questions/2680153/using-xval-with-fields-containing-periods

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!