From a77651677040d93688db07434d3aec363be88977 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 21 Dec 2015 18:12:55 +0100 Subject: [PATCH] form data collection via formkeep.com, ref #2 --- .../javascripts/bigchain/form-earlyaccess.js | 27 ++++++++------ _src/_includes/form-earlyaccess.html | 37 +++++++++++++++++++ _src/index.html | 37 +------------------ 3 files changed, 54 insertions(+), 47 deletions(-) create mode 100644 _src/_includes/form-earlyaccess.html diff --git a/_src/_assets/javascripts/bigchain/form-earlyaccess.js b/_src/_assets/javascripts/bigchain/form-earlyaccess.js index 7a9e717..f240b88 100644 --- a/_src/_assets/javascripts/bigchain/form-earlyaccess.js +++ b/_src/_assets/javascripts/bigchain/form-earlyaccess.js @@ -8,7 +8,8 @@ var FormEarlyAccess = (function(w, d, $) { _config = { form: $('#form-earlyaccess'), formBtn: $('#form-earlyaccess').find('.btn'), - formURL: $('#form-earlyaccess').attr('action') + formURL: $('#form-earlyaccess').attr('action'), + formMethod: $('#form-earlyaccess').attr('method') }; _private = { @@ -18,17 +19,19 @@ var FormEarlyAccess = (function(w, d, $) { if ( $(this).parsley().isValid() ) { - var data = {}; - var dataArray = _config.form.serializeArray(); - $.each(dataArray, function (index, item) { - data[item.name] = item.value; - }); + // var data = {}; + // var dataArray = _config.form.serializeArray(); + // $.each(dataArray, function (index, item) { + // data[item.name] = item.value; + // }); $.ajax({ - url: _config.formURL.replace('/post?', '/post-json?').concat('&c=?'), - data: data, - dataType: 'jsonp', - contentType: 'application/json; charset=utf-8', + url: _config.formURL, + type: _config.formMethod, + accept: { + javascript: 'application/javascript' + }, + data: _config.form.serialize(), crossDomain: true, beforeSend: function() { _config.formBtn @@ -45,7 +48,9 @@ var FormEarlyAccess = (function(w, d, $) { }, error: function(err) { _config.form.find('.alert-danger').removeClass('hide'); - _config.formBtn.removeClass('disabled'); + _config.formBtn + .removeClass('disabled') + .attr('value', 'Send'); // send GA event GoogleAnalytics.gaEventEarlyAccessError(); diff --git a/_src/_includes/form-earlyaccess.html b/_src/_includes/form-earlyaccess.html new file mode 100644 index 0000000..f575a7d --- /dev/null +++ b/_src/_includes/form-earlyaccess.html @@ -0,0 +1,37 @@ + +
+

+ + +

+

+ + +

+

+ + +

+

+ +

+ +
+ + + +

+ Great to hear you’re interested! + We’ll get in touch soon to discuss how we can work together. +

+
+
+ + + +

+ Ops, there was an error + Would you mind trying again? +

+
+
diff --git a/_src/index.html b/_src/index.html index b335af5..02f4785 100644 --- a/_src/index.html +++ b/_src/index.html @@ -61,41 +61,6 @@ front_page: true

For early access and inquiries, enter your contact information below

-
-

- - -

-

- - -

-

- - -

-

- -

- -
- - - -

- Great to hear you’re interested! - We’ll get in touch soon to discuss how we can work together. -

-
-
- - - -

- Ops, there was an error - Would you mind trying again? -

-
-
+ {% include/form-earlyaccess.html %}