diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-03-18 14:17:20 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-03-18 14:19:26 +0100 |
commit | cb4367b6d5af62c8b2c8c384396b3dc29bff2eab (patch) | |
tree | d066222a7b871ca5f73422deaf9fd57e405ac258 /settings/js | |
parent | 093efa458c16ea4a7f7fcaf3f98e1e0fb96624c4 (diff) | |
download | nextcloud-server-cb4367b6d5af62c8b2c8c384396b3dc29bff2eab.tar.gz nextcloud-server-cb4367b6d5af62c8b2c8c384396b3dc29bff2eab.zip |
disable submit button while groupname is empty
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/users/groups.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index c06bc5ff14b..32ddbf3ba01 100644 --- a/settings/js/users/groups.js +++ b/settings/js/users/groups.js @@ -182,6 +182,7 @@ GroupList = { $('#newgroup-form').show(); $('#newgroup-init').hide(); $('#newgroupname').focus(); + GroupList.handleAddGroupInput(''); } else { $('#newgroup-form').hide(); @@ -190,6 +191,14 @@ GroupList = { } }, + handleAddGroupInput: function (input) { + if(input.length) { + $('#newgroup-form input[type="submit"]').attr('disabled', null); + } else { + $('#newgroup-form input[type="submit"]').attr('disabled', 'disabled'); + } + }, + isGroupNameValid: function (groupname) { if ($.trim(groupname) === '') { OC.dialogs.alert( @@ -295,4 +304,8 @@ $(document).ready( function () { $userGroupList.on('click', '.isgroup', function () { GroupList.showGroup(GroupList.getElementGID(this)); }); + + $('#newgroupname').on('input', function(){ + GroupList.handleAddGroupInput(this.value); + }); }); |