From b6bd706c5011a43254f4b3b69ab83a0be013ba91 Mon Sep 17 00:00:00 2001 From: phamt Date: Thu, 13 Oct 2011 15:32:39 +0000 Subject: [PATCH] Check choices before provision on self-service page. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10764 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/custom/zvm.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js index a143f5eeb..51cde9c63 100644 --- a/xCAT-UI/js/custom/zvm.js +++ b/xCAT-UI/js/custom/zvm.js @@ -103,13 +103,22 @@ zvmPlugin.prototype.loadServiceProvisionPage = function(tabId) { */ var provisionBtn = createButton('Provision'); provisionBtn.bind('click', function(event) { + // Remove any warning messages + $(this).parent().find('.ui-state-error').remove(); + var hcp = $('#select-table tbody tr:eq(0) td:eq(0) input[name="hcp"]:checked').val(); var group = $('#select-table tbody tr:eq(0) td:eq(1) input[name="group"]:checked').val(); var img = $('#select-table tbody tr:eq(0) td:eq(2) input[name="image"]:checked').val(); var owner = $.cookie('srv_usrname'); - // Begin by creating VM - createzVM(tabId, group, hcp, img, owner); + if(!hcp || !group || !img) { + // Show warning message + var warn = createWarnBar('You need to select an option for each column'); + warn.prependTo($(this).parent()); + } else { + // Begin by creating VM + createzVM(tabId, group, hcp, img, owner); + } }); provForm.append(provisionBtn);