Skip to content

Instantly share code, notes, and snippets.

@davidmccoy
Last active October 31, 2020 09:56
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save davidmccoy/1dc29afb10e53923452ac2dca5df8def to your computer and use it in GitHub Desktop.
Save davidmccoy/1dc29afb10e53923452ac2dca5df8def to your computer and use it in GitHub Desktop.
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
);
})
@oscarlaf03
Copy link

Pardon my ignorance. I am code newbie and this might be a very basic question. So I should create a *.js file with this code right? and after that, How do I link this js file to my html form file?

@Lulucmy
Copy link

Lulucmy commented Feb 25, 2018

Hey @oscarlaf03,

You have to create a separated file (nameyouwant.js) and then connect it to your webpage : <script type="text/javascript" src="nameyouwant.js"/>

@shaharyogev
Copy link

@rupesh123W
Copy link

i used below complete method and used html in notepad section but its not working ???
https://medium.com/@dmccoy/how-to-submit-an-html-form-to-google-sheets-without-google-forms-b833952cc175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment