How can i add custom jquery validation rules against the fields generated from knockoutjs's template items?
In this modified example of 'Editable grid' (http://jsfiddle.开发者_如何学Cnet/cEy2X/), I have changed the Price field to a Date field. I would like to add custom jQuery validation rules on the date fields. I know jQuery Validation has a built-in 'date' for that, but it's just a dumb javascript date format check.
Thanks for the help.
Replace your the part where it validates the price for a number with the following
<td><input class='required date' data-bind='value: price, uniqueName: true' /></td>
change number to date and it does validates the date for you. if that what you want.
http://jsfiddle.net/cEy2X/15/
精彩评论