disable submit button while groupname is empty
This commit is contained in:
parent
093efa458c
commit
cb4367b6d5
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue