anchor.diff:  
   block ScriptsPluginBlock
   block ScriptsBlock
  +    include ../shared/_validate
       script(type='application/javascript').
  +        var words = {
  +            empty: '!{emptyAgents}'
  +        };
  +
           $(function () {
               setActiveLink('#server', '#server-groups-sub');
   
  -            $('#create-group-modal').on('submit', function (e) {
  -                e.preventDefault();
  +            var $createModal = $('#create-group-modal');
   
  -                var $elem = $(this);
  -
  -                $elem.find('button[type="submit"]').attr('disabled', true);
  -
  -                var name = $elem.find('input[name="name"]').val();
  -                var server = $elem.find('select[name="server"] > option:selected').val();
  +            validateModal(null, $createModal, {
  +                name: {
  +                    required: true,
  +                    maxlength: 100
  +                },
  +                server: {
  +                    required: true
  +                }
  +            }, function () {
  +                var name = $('input[name="name"]', $createModal).val();
  +                var server = $('select[name="server"] > option:selected', $createModal).val();
                   var agents = [];
   
  -                $elem.find('input[name="worker"]').each(function () {
  +                $('input[name="worker"]', $createModal).each(function () {
                       if (this.checked) {
                           agents.push($(this).parent().find('input[name="worker-id"]').val());
                       }
                   });
  +
  +                if (!agents.length) {
  +                    return toastr.warning(words.empty);
  +                }
  +
  +                $('button[type="submit"]', $createModal).attr('disabled', true);
   
                   $.ajax({
                       url: '/servers/groups',
                       type: 'POST',
                       contentType: 'application/json',
                       data: JSON.stringify({
  -                        _csrf: $elem.find('input[name="_csrf"]').val(),
  +                        _csrf: _csrf,
                           name: name,
                           server: server,
                           agents: agents
  
positive.code:                             location.reload();
                          } else {
                              toastr.error(result.msg);
                              $elem.find('button[type="submit"]').attr('disabled', false);
                          }
                      }
                  });
  
negative.code:                     url: $elem.attr('href'),
                      type: 'DELETE',
                      contentType: 'application/json',
                      data: JSON.stringify({_csrf: _csrf}),
                      dataType: 'json',
                      cache: false,
                      error: function (XMLHttpRequest, textStatus, errorThrow) {
  