diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 1f68ff75ae..6e817d1a5c 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -738,7 +738,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' elem = document.getElementById('group-modal-dialog'); $compile(elem)(modal_scope); + var form_scope = generator.inject(GroupForm, { mode: 'edit', id: 'properties-tab', breadCrumbs: false, related: false, scope: properties_scope }); + var source_form_scope = generator.inject(SourceForm, { mode: 'edit', id: 'sources-tab', breadCrumbs: false, related: false, scope: sources_scope }); //generator.reset(); @@ -881,6 +883,11 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' modal_scope.cancelModal(); }, open: function () { + function updateButtonStatus(isValid) { + $('.ui-dialog[aria-describedby="group-modal-dialog"]').find('.btn-primary').prop('disabled', !isValid); + } + form_scope.$watch('group_form.$valid', updateButtonStatus); + source_form_scope.$watch('source_form.$valid', updateButtonStatus); $('#group_name').focus(); Wait('stop'); } diff --git a/awx/ui/static/js/helpers/Hosts.js b/awx/ui/static/js/helpers/Hosts.js index 61cbf33cd7..df9e045bf7 100644 --- a/awx/ui/static/js/helpers/Hosts.js +++ b/awx/ui/static/js/helpers/Hosts.js @@ -471,8 +471,9 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H scope = parent_scope.$new(), master = {}, relatedSets = {}, - buttons, url; + buttons, url, form_scope; + var form_scope = generator.inject(HostForm, { mode: 'edit', id: 'host-modal-dialog', breadCrumbs: false, related: false, scope: scope }); generator.reset();