From 400eb04c4983a338b03bd94457c3fd5530d864b5 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 26 Jan 2012 22:58:01 +0000 Subject: [PATCH] fix validation messages layout and prevent displaying undefined for non mandatory fields git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1236437 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/network-proxies.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js index 75a0b8285..77b9a7c40 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js @@ -37,10 +37,10 @@ $(function() { this.port=ko.observable(port); //private String username; - this.username=ko.observable(username); + this.username=ko.observable(username?username:""); //private String password; - this.password=ko.observable(password); + this.password=ko.observable(password?password:""); } NetworkProxyViewModel=function(networkProxy, update, networkProxiesViewModel){ @@ -188,7 +188,11 @@ $(function() { } activateNetworkProxyFormValidation=function(){ - $("#main-content #network-proxy-edit-form").validate(); + $("#main-content #network-proxy-edit-form").validate({ + showErrors: function(validator, errorMap, errorList) { + customShowError(validator,errorMap,errorMap); + } + }); } activateNetworkProxiesGridTab=function(){