0

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.net/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.

1 Answer 1

1

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/

Sign up to request clarification or add additional context in comments.

1 Comment

I want to avoid the built-in 'date' validation since it's not a good validation based on javascript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.