-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation Messages showing on Initial Load #241
Comments
You should be able to manually set |
Hi Steve, Thanks for replying. We are manually setting isModified(false) as mentioned above. Will setup a jsFiddle and post the link to it here... |
Hi Steve, Here is a JsFiddle of what I am trying to achieve - http://jsfiddle.net/h3Efe/7/ The Add button should popup the "EditLeaveForm" div as a modal with the Hour property required. As soon as the popup loads, the knockout validations is firing - even though I set this.hours.isModified(false); in the add function Help will be greatly appreciated thanks |
Sorry Steve - the previous fiddle isn't working. Have simplified it - http://jsfiddle.net/3Lqsx/1307/ As you can see "Hours Required" comes up on load thanks |
I believe the problem is that you are directly binding to the You could try creating a computed |
Thats helpful. thanks Steve! I assume there is no validation summary support in the knockout validation library and this is the way its usually done? thanks |
@jatindua81 I have created the pull request #226 which gives you a summary support. |
Closing this issue since Steve provided all the necessary details and example. |
Hi There
We are currently working on a razor application using knockout 2.1. We have started using the knockout validation library.
The issue is that we have a view with an Add button. Clicking the Add button results in a popup with a couple of Select and date picker controls. Problem is that the ko validations are being fired on the initial load of the popup. What are we missing here - maybe on the initial load of the view, knockout thinks the view model has changed and therefore fires the validations? How can we determine which property on the view model has changed and is there a way to stop that explicitly?
We are trying "this.<>.isModified(false)" but no luck. This isnt working too:
ko.validation.configure({
registerExtenders: true,
messagesOnModified: true,
insertMessages: false,
parseInputAttributes: true,
messageTemplate: null,
grouping: {
deep: true
}
});
Any help will be appreciated guys
Thanks
Jatin
The text was updated successfully, but these errors were encountered: