]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
add VType for password confirmation
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 29 Mar 2017 15:50:05 +0000 (17:50 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 29 Mar 2017 16:02:23 +0000 (18:02 +0200)
Toolkit.js

index 4849559b3edf23efac98bedd041d4f1764f43b92..811bbca77d2da10c2fb7f7282d47fd0f6f494646 100644 (file)
@@ -124,7 +124,18 @@ Ext.apply(Ext.form.field.VTypes, {
 
        return true;
     },
-    HostListText: gettext('Not a valid list of hosts')
+    HostListText: gettext('Not a valid list of hosts'),
+
+    password: function(val, field) {
+        if (field.initialPassField) {
+            var pwd = field.up('form').down(
+               '[name=' + field.initialPassField + ']');
+            return (val == pwd.getValue());
+        }
+        return true;
+    },
+
+    passwordText: gettext('Passwords do not match')
 });
 
 // ExtJs 5-6 has an issue with caching