code: function ajax(input) {
          return new Promise(function (valid, invalid) {
              if (input.dataset.ajax !== undefined && input.value.length > 0) {
                  var url = input.dataset.ajax.replace('{value}', encodeURIComponent(input.value));
                  Ajax.get(url, function (data) {
                      data = JSON.parse(data);
                      if (data.message !== undefined && data.message !== '') {
                          invalid(data.message);
                      } else {
                          valid();
                      }
                  }, function () {
                      invalid('Ajax error');
                  });
              } else {
                  valid();
              }
          });
      }
docs: if input's value is not empty and input has attribute "data-ajax" which should contain ajax URL with {value} which will be replaced by URI encoded input.value then ajax request will be made to validate input  ajax request should return JSON response if JSON response has "message" key and message key is not empty string - input is invalid server should return validation error message, it may contain {label} Does not works with file inputs