Hi Guys!
So, basically, i'm using bootstrap and i want to set the error messages format so i can match my website pattern.
In order to do this, i need to get the Element ( as the observable element or elements ) being validated and also the error message i set.
An example:
var viewModelUser = ko.validatedObservable({
email: ko.observable().extend({ required: { message: 'Please supply your email address.' } }),
if (viewModelUser.isValid() == false) {
var errors = viewModelUser.errors();
for (var j = 0; j < errors.length; j++) {
// HERE I NEED TO GET THE ELEMENT AND THE ERROR MESSAGE ITSELF
}
return false;
}
How can i do this?
Thanks in advange!
Hi Guys!
So, basically, i'm using bootstrap and i want to set the error messages format so i can match my website pattern.
In order to do this, i need to get the Element ( as the observable element or elements ) being validated and also the error message i set.
An example:
var viewModelUser = ko.validatedObservable({
email: ko.observable().extend({ required: { message: 'Please supply your email address.' } }),
if (viewModelUser.isValid() == false) {
var errors = viewModelUser.errors();
for (var j = 0; j < errors.length; j++) {
// HERE I NEED TO GET THE ELEMENT AND THE ERROR MESSAGE ITSELF
}
return false;
}
How can i do this?
Thanks in advange!