Using xval with fields containing periods

Posted by JP on Stack Overflow See other posts from Stack Overflow or by JP
Published on 2010-04-21T03:42:01Z Indexed on 2010/04/24 17:13 UTC
Read the original article Hit count: 184

Filed under:
|
|

Hello,

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!

© Stack Overflow or respective owner

Related posts about xval

Related posts about asp.net-mvc