AutoForm.hooks({
    inviteMembersForm: {
        onSubmit: function(insert, doc) {
            //return false;
        },
        onError: function(insert, error, template) {
            return console.log(error);
        },
        onSuccess: function(insert, doc) {
            console.log(doc);
            wAlert.success(i18n.t('invitation_send_successfully'));
            $('#inviteMembersModal').modal('hide');
        }
    }
});
@@ -185,32 +185,53 @@
     
-return console.log(error
+$('#submitMembersForm').removeClass('loading'
 );%0A 

remove loading class on error when submitting inviteMembersForm