Last active
April 21, 2021 21:30
-
-
Save rememberlenny/9de4fdeb5c487ba020fb to your computer and use it in GitHub Desktop.
How to post to Google docs using a jQuery ajax POST request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// url is the link for the form view page | |
// data is the name attribute of the field | |
$.ajax({ | |
url: "https://docs.google.com/forms/d/1iqMixtVq4O0AFvYCZHbGerigi1G5Qb3XthXZX9VpNtk/formResponse", | |
data: { "entry.1679407376": field1}, | |
type: "POST", | |
dataType: "xml", | |
statusCode: { | |
0: function() { | |
//Success message | |
}, | |
200: function() { | |
//Success Message | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = new XMLHttpRequest(); | |
var d = new Date(); | |
var n = d.getTime(); | |
var url = 'https://docs.google.com/forms/d/1FhRXyqVohna2IdThVwONXLAAGW4f6Ioy46BR2MRZy68/formResponse'; | |
var data = { "entry.993789377": n}; | |
request.open('POST', url, true); | |
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); | |
request.send(data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm surprised people still use this!