I have a form that uses google docs and when you submit it will go to googles default thank you page. What I want to do is use ajax instead to send the data so the user won’t leave the site. Google requires certain hidden fields for their end. How can I pass hidden fields in ajax? Below is the code I wrote.
$.ajax({
type: "post",
url: "https://spreadsheets.google.com/formResponse?formkey=HEREISWHEREMYKEYGOES",
data: "name=entry.1.group&value=24",
success: function() {
alert("yay")
},
error: function(e) {
console.log(e);
}
});
If you want to add fields to a
stringin javascript, you can use below code. Make sure to replaceWhateverfieldto the actual field, but I would need to see the HTML to provide a full answer.Ideally, you use something like this for the data: