Client-side validation for a list of items

Nov 17, 2009 at 12:55 AM

Has anyone figured out how to use xVal to perform jQuery validation for each one of a list of items? I'm displaying a list of items in a grid, and would like to validate each item. Specifically, I'm naming each item according to the pattern 'model.items[n]' to use MVC model binding. I've even tried explicitly setting up validation on each item but this doesn't seem to work either.

<%= Html.ClientSideValidation<MyItemClass>("items[0]") %>

 

FWIW - Steve mentioned this in a blog post a while back:

"One of the things on my to-do list is documenting how to use xVal when editing a list (e.g., rows in an editable grid)."