docs: function(data, options) {
  
          var $target = this.target , id = $target.getAttribute('id');
          var $form = instance.$forms[id] || this;
  
          // forward callback to HTML attribute
          listenToXhrEvents($form);
  
          if (options) {
              var options = merge(options, xhrOptions);
          } else {
              var options = xhrOptions;
          }
  
          var url         = $target.getAttribute('action') || options.url;
          var method      = $target.getAttribute('method') || options.method;
          method          = method.toUpperCase();
          options.method  = method;
          options.url     = url;
  
          // to upload, use `multipart/form-data` for `enctype`
          var enctype = $target.getAttribute('enctype');
  
          if ( options.withCredentials ) {
  
              if ('withCredentials' in xhr) {
                  // XHR for Chrome/Firefox/Opera/Safari.
                  if (options.isSynchrone) {
                      xhr.open(options.method, options.url, options.isSynchrone)
                  } else {
                      xhr.open(options.method, options.url)
                  }
              } else if ( typeof XDomainRequest != 'undefined' ) {
                  // XDomainRequest for IE.
                  xhr = new XDomainRequest();
                  xhr.open(options.method, options.url);
              } else {
                  // CORS not supported.
                  xhr = null;
                  var result = 'CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';
                  triggerEvent(gina, $target, 'error.' + id, result);
  
                  return
              }
  
              xhr.withCredentials = true;
          } else {
              if (options.isSynchrone) {
                  xhr.open(options.method, options.url, options.isSynchrone)
              } else {
                  xhr.open(options.method, options.url)
              }
          }
  
          // setting up headers
          for (var hearder in options.headers) {
              if ( hearder == 'Content-Type' && typeof (enctype) != 'undefined' && enctype != null && enctype != '') {
                  options.headers[hearder] = enctype
              }
  
              xhr.setRequestHeader(hearder, options.headers[hearder]);
          }
  
          if (xhr) {
              // catching ready state cb
              xhr.onreadystatechange = function (event) {
  
                  if (xhr.readyState == 4) {
                      // 200, 201, 201' etc ...
                      if( /^2/.test(xhr.status) ) {
  
                          try {
                              var result = xhr.responseText;
                              if ( /json$/.test( xhr.getResponseHeader("Content-Type") ) ) {
                                  result = JSON.parse(xhr.responseText)
                              }
  
                              $form.eventData.success = result;
  
                              var XHRData = result;
                              if ( gina && typeof(window.ginaToolbar) == "object" && XHRData ) {
                                  try {
  
                                      if ( typeof(XHRData) != 'undefined' ) {
                                          window.ginaToolbar.update("data-xhr", XHRData);
                                      }
  
                                  } catch (err) {
                                      throw err
                                  }
                              }
  
                              triggerEvent(gina, $target, 'success.' + id, result)
  
                          } catch (err) {
                              var result = {
                                  status:  422,
                                  error : err.message,
                                  stack : err.stack
  
                              };
  
                              $form.eventData.error = result;
  
                              // // update toolbar
                              // var XHRData = result;
                              // if ( gina && typeof(window.ginaToolbar) == "object" && XHRData ) {
                              //     try {
                              //
                              //         // forward backend appplication errors to forms.errors when available
                              //         if ( XHRData.error && typeof(XHRData.error) == 'object' && $form.fields ) {
                              //             var formsErrors = {}, errCount = 0;
                              //             for (var e in XHRData.error) {
                              //                 if ( typeof($form.fields[e]) != 'undefined' ) {
                              //                     ++errCount;
                              //                     formsErrors[e] = XHRData.error[e];
                              //
                              //                     if ( typeof(XHRData.stack) != 'undefined' )
                              //                         formsErrors[e].stack = XHRData.stack;
                              //                 }
                              //             }
                              //
                              //             if (errCount > 0) {
                              //                 handleErrorsDisplay($form.target, formsErrors);
                              //             }
                              //         }
                              //         // update toolbar
                              //         ginaToolbar.update("data-xhr", XHRData );
                              //
                              //     } catch (err) {
                              //         throw err
                              //     }
                              // }
  
                              var XHRData = result;
                              if ( gina && typeof(window.ginaToolbar) == "object" && XHRData ) {
                                  try {
  
                                      if ( typeof(XHRData) != 'undefined' ) {
                                          window.ginaToolbar.update("data-xhr", XHRData);
                                      }
  
                                  } catch (err) {
                                      throw err
                                  }
                              }
  
                              triggerEvent(gina, $target, 'error.' + id, result)
                          }
  
                      } else if ( xhr.status != 0) {
  
                          var result = { 'status': xhr.status };
  
                          if ( /^(\{|\[).test( xhr.responseText ) /) {
  
                              try {
                                  result = JSON.parse(xhr.responseText);
                              } catch (err) {
                                  result = merge(result, err)
                              }
  
                          } else if ( typeof(xhr.responseText) == 'object' ) {
                              result = xhr.responseText
                          } else {
                              result.message = xhr.responseText
                          }
  
                          $form.eventData.error = result;
  
                          // update toolbar
                          var XHRData = result;
                          if ( gina && typeof(window.ginaToolbar) == "object" && XHRData ) {
                              try {
  
                                  // forward backend appplication errors to forms.errors when available
                                  if ( XHRData.error && typeof(XHRData.error) == 'object' && $form.fields ) {
                                      var formsErrors = {}, errCount = 0;
                                      for (var e in XHRData.error) {
                                          if ( typeof($form.fields[e]) != 'undefined' ) {
                                              ++errCount;
                                              formsErrors[e] = XHRData.error[e];
  
                                              if ( typeof(XHRData.stack) != 'undefined' )
                                                  formsErrors[e].stack = XHRData.stack;
                                          }
                                      }
  
                                      if (errCount > 0) {
                                          handleErrorsDisplay($form.target, formsErrors);
                                      }
                                  }
                                  // update toolbar
                                  ginaToolbar.update('data-xhr', XHRData );
  
                              } catch (err) {
                                  throw err
                              }
                          }
  
                          triggerEvent(gina, $target, 'error.' + id, result)
                      }
                  }
              };
  
              // catching request progress
              xhr.onprogress = function(event) {
                  // console.log(
                  //    'progress position '+ event.position,
                  //    '\nprogress total size '+ event.totalSize
                  // );
  
                  var percentComplete = (event.position / event.totalSize)*100;
                  var result = {
                      'status': 100,
                      'progress': percentComplete
                  };
  
                  $form.eventData.onprogress = result;
  
                  triggerEvent(gina, $target, 'progress.' + id, result)
              };
  
              // catching timeout
              xhr.ontimeout = function (event) {
                  var result = {
                      'status': 408,
                      'error': 'Request Timeout'
                  };
  
                  $form.eventData.ontimeout = result;
  
                  triggerEvent(gina, $target, 'error.' + id, result)
              };
  
  
              // sending
              if (!data)
                  data = event.detail.data;
  
              if (data) {
                  if ( typeof(data) == 'object' ) {
                      try {
                          data = JSON.stringify(data)
                      } catch (err) {
                          triggerEvent(gina, $target, 'error.' + id, err)
                      }
                  }
                  //console.log('sending -> ', data);
                  //try {
                      xhr.send(data)
                  // } catch (err) {
                  //     var XHRData = result;
                  //     if ( gina && typeof(window.ginaToolbar) == "object" && XHRData ) {
                  //         try {
                  //
                  //             if ( typeof(XHRData) != 'undefined' ) {
                  //                 window.ginaToolbar.update("data-xhr", XHRData);
                  //             }
                  //
                  //         } catch (err) {
                  //             throw err
                  //         }
                  //     }
                  // }
  
              } else {
                  xhr.send()
              }
              $form.sent = true;
  
  
          }
      }