Hey guys,
I am creating a kind of a Web Hook to post a new row to my Google Sheet everytime a user submits a form.
I wanted to implement an AJAX request to the URL for my web app/script whenever the form is submitted but I’m having problem as the example code i have contain the form id instead of the ids for the various input and text fields i want to capture.
This is what the example code looks like:
var $form = $('form#test-form'),
url = 'https://script.google.com/macros/s/abcdefghijklmnopqrstuvwxyz1234567890/exec'
$('#submit-form').on('click', function(e) {
e.preventDefault();
var jqxhr = $.ajax({
url: url,
method: "GET",
dataType: "json",
data: $form.serializeObject()
}).success(
// do something
);
})
I have 11 input fields and two text fields which i need to capture to my google sheets. I took care of the coding on Google Sheet part. I just need help on coding the website.
Everything is getting stored in wix database seamlessly.
Also, I already have a onclick code implemented for my submit button, should i enter this code below ?
If you can help me I would be ever grateful.