<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Tested this patch and got issues below:<br>
<br>
1. Once I input the storage pool name, an error message occurs
which looks like some request is sent.<br>
<img src="cid:part1.01070908.03040401@linux.vnet.ibm.com"
alt=""><br>
<br>
2. The button is enabled only when the 'Storage Path' field lose
focus.<br>
it should bind to 'keyup' event to make the button enabled
once there is a valid input and disabled once user clear the path.<br>
<img src="cid:part2.08050604.05030705@linux.vnet.ibm.com"
alt=""><br>
<br>
<br>
On 5/14/2014 11:38 AM, <a class="moz-txt-link-abbreviated" href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a> wrote:<br>
</div>
<blockquote
cite="mid:1400038700-6332-1-git-send-email-shaohef@linux.vnet.ibm.com"
type="cite">
<pre wrap="">From: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
All button status of add/create pages should be consistent - it should
be disabled by default until the minimum of the required fields are
filled.
Signed-off-by: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
---
ui/js/src/kimchi.storagepool_add_main.js | 8 ++++++++
ui/pages/storagepool-add.html.tmpl | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 86dbe7f..7bed152 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -145,6 +145,14 @@ kimchi.initStorageAddPage = function() {
$('#iscsiportId').keyup(function(event) {
$(this).toggleClass("invalid-field",!/^[0-9]+$/.test($(this).val()));
});
+ $('#form-pool-add').change(function() {
+ if (kimchi.validateForm()) {
+ $('#pool-doAdd').removeAttr('disabled');
+ } else {
+ $('#pool-doAdd').attr('disabled', 'disabled');
+ }
+
+ });
};
kimchi.validateForm = function() {
diff --git a/ui/pages/storagepool-add.html.tmpl b/ui/pages/storagepool-add.html.tmpl
index 977db66..7406bab 100644
--- a/ui/pages/storagepool-add.html.tmpl
+++ b/ui/pages/storagepool-add.html.tmpl
@@ -152,7 +152,7 @@
</div>
<footer>
<div class="btn-group">
- <button id="pool-doAdd" class="btn-normal">
+ <button id="pool-doAdd" class="btn-normal" disabled="disabled">
<span class="text">$_("Create")</span>
</button>
</div>
</pre>
</blockquote>
<br>
</body>
</html>