var invalidObservables = {};
for ( var prop in viewModel ) {
if ( viewModel.hasOwnProperty( prop ) && ko.isObservable( viewModel[ prop ] ) ) {
if ( viewModel[ prop ].hasOwnProperty( 'isValid' ) && !viewModel[ prop ].isValid() ) {
invalidObservables[ prop ] = viewModel[ prop ];
}
}
}
Need to find all invalid dom elements using knockout-validation
-
01-07-2023 - |
Domanda
I am using knockout-validation for validation. I need to find all the observable variables which are invalid.
How can I find that?
please help.
thanks
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow