0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-04 19:33:22 +01:00

Settings validation messages are properly cleared

This commit is contained in:
peteruithoven 2013-10-23 15:32:28 +02:00
parent cc2bcf962c
commit 11c1764074

View File

@ -245,16 +245,13 @@ function SettingsWindow() {
} }
this.displayValidationError = function(key,msg) { this.displayValidationError = function(key,msg) {
var formElement = self.form.find("[name|='"+key+"']"); var formElement = self.form.find("[name|='"+key+"']");
console.log("formElement: ",formElement);
formElement.addClass("error"); formElement.addClass("error");
var errorMsg = "<p class='errorMsg'>"+msg+"</p>" var errorMsg = "<p class='errorMsg'>"+msg+"</p>"
formElement.after(errorMsg); formElement.after(errorMsg);
} }
this.clearValidationErrors = function() { this.clearValidationErrors = function() {
var formElements = self.form.find(".error"); self.form.find(".errorMsg").remove();
formElements.each( function(index,element) { self.form.find(".error").removeClass("error");
$(element).removeClass("error");
});
} }
this.readForm = function() { this.readForm = function() {