[pve-devel] [PATCH manager] disable submit button in migrate window when not valid

Dominik Csapak d.csapak at proxmox.com
Mon Jan 9 15:40:07 CET 2017


when the form is not valid (e.g. an offline or no host selected),
disable the submit button

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/window/Migrate.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
index 95d4f3e..dfc8da3 100644
--- a/www/manager6/window/Migrate.js
+++ b/www/manager6/window/Migrate.js
@@ -126,5 +126,11 @@ Ext.define('PVE.window.Migrate', {
 	});
 
 	me.callParent();
+
+	me.mon(me.formPanel, 'validitychange', function(fp, isValid) {
+	    submitBtn.setDisabled(!isValid);
+	});
+
+	me.formPanel.isValid();
     }
 });
-- 
2.1.4





More information about the pve-devel mailing list