You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to update the validation rules of some fields that depend on the values of others on the fly, with no success. Sample code is at http://jsfiddle.net/2vfaV/3/
"deneme" is the main field and validation of "bagimli" depends on the value of deneme. How can i update the validation rule of bagimli?
The text was updated successfully, but these errors were encountered:
I believe this is happening because ko.validation is not over-writing your previously added rule, and instead is adding an additional 'required' rule. Also, the required rule hasn't really been tested with a false setting, as ko.validation is not really designed for changing rules on the fly.
But, like I said... required isn't really expecting to have a 'false' value.
One other option you have is to do .extend({ validatable: false }); ... that will erase all validation from the observable, and then you can - re-assign validation to it. The only problem here is that you would have to call ko.applyBindings again.
I'm trying to update the validation rules of some fields that depend on the values of others on the fly, with no success. Sample code is at http://jsfiddle.net/2vfaV/3/
"deneme" is the main field and validation of "bagimli" depends on the value of deneme. How can i update the validation rule of bagimli?
The text was updated successfully, but these errors were encountered: