Bad HTML contact form redirecting to script.googleusercontent.com after submission











up vote
0
down vote

favorite












The following contact form http://wearedappr.com/contact.html send all informations to a google spreadsheet after submitting. However, it also redirects the user to https://script.googleusercontent.com (See image below)
current redirection



I am trying to have a confirmation message appearing instead of the redirection. Something like "Thanks for contacting us! We will get back to you soon!" which would appear on the contact form page once we submit it instead.



Can someone help by any chance?



Here is form-submission-handler.js:
http://wearedappr.com/form-submission-handler.js










share|improve this question






















  • Can you share your HTML code.
    – Chuka Okoye
    Nov 8 at 19:48










  • I suspect you are submitting the form directly to Google. The best way to achieve what you want is by using Ajax to submit the form them parse the json response and present you confirmation message if successful
    – Chuka Okoye
    Nov 8 at 19:49










  • here is the HTML code view-source:wearedappr.com/contact.html
    – JohnDoe974
    Nov 8 at 20:14










  • @ChukaOkoye, I have been trying to do what you described but without any success. Do you know where I could find an example of this by any chance? Thank you
    – JohnDoe974
    Nov 10 at 8:41










  • I will post an answer shortly. Give me a moment to get on my pc
    – Chuka Okoye
    Nov 10 at 11:37















up vote
0
down vote

favorite












The following contact form http://wearedappr.com/contact.html send all informations to a google spreadsheet after submitting. However, it also redirects the user to https://script.googleusercontent.com (See image below)
current redirection



I am trying to have a confirmation message appearing instead of the redirection. Something like "Thanks for contacting us! We will get back to you soon!" which would appear on the contact form page once we submit it instead.



Can someone help by any chance?



Here is form-submission-handler.js:
http://wearedappr.com/form-submission-handler.js










share|improve this question






















  • Can you share your HTML code.
    – Chuka Okoye
    Nov 8 at 19:48










  • I suspect you are submitting the form directly to Google. The best way to achieve what you want is by using Ajax to submit the form them parse the json response and present you confirmation message if successful
    – Chuka Okoye
    Nov 8 at 19:49










  • here is the HTML code view-source:wearedappr.com/contact.html
    – JohnDoe974
    Nov 8 at 20:14










  • @ChukaOkoye, I have been trying to do what you described but without any success. Do you know where I could find an example of this by any chance? Thank you
    – JohnDoe974
    Nov 10 at 8:41










  • I will post an answer shortly. Give me a moment to get on my pc
    – Chuka Okoye
    Nov 10 at 11:37













up vote
0
down vote

favorite









up vote
0
down vote

favorite











The following contact form http://wearedappr.com/contact.html send all informations to a google spreadsheet after submitting. However, it also redirects the user to https://script.googleusercontent.com (See image below)
current redirection



I am trying to have a confirmation message appearing instead of the redirection. Something like "Thanks for contacting us! We will get back to you soon!" which would appear on the contact form page once we submit it instead.



Can someone help by any chance?



Here is form-submission-handler.js:
http://wearedappr.com/form-submission-handler.js










share|improve this question













The following contact form http://wearedappr.com/contact.html send all informations to a google spreadsheet after submitting. However, it also redirects the user to https://script.googleusercontent.com (See image below)
current redirection



I am trying to have a confirmation message appearing instead of the redirection. Something like "Thanks for contacting us! We will get back to you soon!" which would appear on the contact form page once we submit it instead.



Can someone help by any chance?



Here is form-submission-handler.js:
http://wearedappr.com/form-submission-handler.js







html google-apps-script contact-form






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 8 at 16:43









JohnDoe974

1514




1514












  • Can you share your HTML code.
    – Chuka Okoye
    Nov 8 at 19:48










  • I suspect you are submitting the form directly to Google. The best way to achieve what you want is by using Ajax to submit the form them parse the json response and present you confirmation message if successful
    – Chuka Okoye
    Nov 8 at 19:49










  • here is the HTML code view-source:wearedappr.com/contact.html
    – JohnDoe974
    Nov 8 at 20:14










  • @ChukaOkoye, I have been trying to do what you described but without any success. Do you know where I could find an example of this by any chance? Thank you
    – JohnDoe974
    Nov 10 at 8:41










  • I will post an answer shortly. Give me a moment to get on my pc
    – Chuka Okoye
    Nov 10 at 11:37


















  • Can you share your HTML code.
    – Chuka Okoye
    Nov 8 at 19:48










  • I suspect you are submitting the form directly to Google. The best way to achieve what you want is by using Ajax to submit the form them parse the json response and present you confirmation message if successful
    – Chuka Okoye
    Nov 8 at 19:49










  • here is the HTML code view-source:wearedappr.com/contact.html
    – JohnDoe974
    Nov 8 at 20:14










  • @ChukaOkoye, I have been trying to do what you described but without any success. Do you know where I could find an example of this by any chance? Thank you
    – JohnDoe974
    Nov 10 at 8:41










  • I will post an answer shortly. Give me a moment to get on my pc
    – Chuka Okoye
    Nov 10 at 11:37
















Can you share your HTML code.
– Chuka Okoye
Nov 8 at 19:48




Can you share your HTML code.
– Chuka Okoye
Nov 8 at 19:48












I suspect you are submitting the form directly to Google. The best way to achieve what you want is by using Ajax to submit the form them parse the json response and present you confirmation message if successful
– Chuka Okoye
Nov 8 at 19:49




I suspect you are submitting the form directly to Google. The best way to achieve what you want is by using Ajax to submit the form them parse the json response and present you confirmation message if successful
– Chuka Okoye
Nov 8 at 19:49












here is the HTML code view-source:wearedappr.com/contact.html
– JohnDoe974
Nov 8 at 20:14




here is the HTML code view-source:wearedappr.com/contact.html
– JohnDoe974
Nov 8 at 20:14












@ChukaOkoye, I have been trying to do what you described but without any success. Do you know where I could find an example of this by any chance? Thank you
– JohnDoe974
Nov 10 at 8:41




@ChukaOkoye, I have been trying to do what you described but without any success. Do you know where I could find an example of this by any chance? Thank you
– JohnDoe974
Nov 10 at 8:41












I will post an answer shortly. Give me a moment to get on my pc
– Chuka Okoye
Nov 10 at 11:37




I will post an answer shortly. Give me a moment to get on my pc
– Chuka Okoye
Nov 10 at 11:37












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Try these.



1, Change your opening form tag to this:



<form class="gform pure-form pure-form-stacked" id="google_form_submit">


2, Add the following to your code before the closing body tag



<script type="text/javascript">
$('#google_form_submit').submit(function(e){
e.preventDefault();
var formData = $('#google_form_submit').serialize();
$.ajax({
type : 'POST',
url : 'https://script.google.com/macros/s/AKfycbzBvgWZZUgFbxCAlhPG4429wth61Rm7kymPaui3d5328UHHOiA/exec',
data : formData,
dataType : 'json',
encode : true
}).done(function(data) {
if(data.result == 'success') {
// Form submission was successful and accepted by google.
// You can show your success message here

} else {
// Form was submission failed for some reasons.
// You can examine the response from google to see whats missing

}
}).fail(function (jqXHR,status,err) {
// Form submission failed due to some network or other errors
// I am alerting the error but you can do anything else with it
alert(err);
});
});
</script>


Pardon my untidy codes... am posting the answer from a tablet.
If you see any thing wrong let me know so I can fix






share|improve this answer





















  • Thank you @Chuka Okoye
    – JohnDoe974
    Nov 16 at 10:36










  • Glad I could help
    – Chuka Okoye
    Nov 17 at 11:45











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53212327%2fbad-html-contact-form-redirecting-to-script-googleusercontent-com-after-submissi%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










Try these.



1, Change your opening form tag to this:



<form class="gform pure-form pure-form-stacked" id="google_form_submit">


2, Add the following to your code before the closing body tag



<script type="text/javascript">
$('#google_form_submit').submit(function(e){
e.preventDefault();
var formData = $('#google_form_submit').serialize();
$.ajax({
type : 'POST',
url : 'https://script.google.com/macros/s/AKfycbzBvgWZZUgFbxCAlhPG4429wth61Rm7kymPaui3d5328UHHOiA/exec',
data : formData,
dataType : 'json',
encode : true
}).done(function(data) {
if(data.result == 'success') {
// Form submission was successful and accepted by google.
// You can show your success message here

} else {
// Form was submission failed for some reasons.
// You can examine the response from google to see whats missing

}
}).fail(function (jqXHR,status,err) {
// Form submission failed due to some network or other errors
// I am alerting the error but you can do anything else with it
alert(err);
});
});
</script>


Pardon my untidy codes... am posting the answer from a tablet.
If you see any thing wrong let me know so I can fix






share|improve this answer





















  • Thank you @Chuka Okoye
    – JohnDoe974
    Nov 16 at 10:36










  • Glad I could help
    – Chuka Okoye
    Nov 17 at 11:45















up vote
0
down vote



accepted










Try these.



1, Change your opening form tag to this:



<form class="gform pure-form pure-form-stacked" id="google_form_submit">


2, Add the following to your code before the closing body tag



<script type="text/javascript">
$('#google_form_submit').submit(function(e){
e.preventDefault();
var formData = $('#google_form_submit').serialize();
$.ajax({
type : 'POST',
url : 'https://script.google.com/macros/s/AKfycbzBvgWZZUgFbxCAlhPG4429wth61Rm7kymPaui3d5328UHHOiA/exec',
data : formData,
dataType : 'json',
encode : true
}).done(function(data) {
if(data.result == 'success') {
// Form submission was successful and accepted by google.
// You can show your success message here

} else {
// Form was submission failed for some reasons.
// You can examine the response from google to see whats missing

}
}).fail(function (jqXHR,status,err) {
// Form submission failed due to some network or other errors
// I am alerting the error but you can do anything else with it
alert(err);
});
});
</script>


Pardon my untidy codes... am posting the answer from a tablet.
If you see any thing wrong let me know so I can fix






share|improve this answer





















  • Thank you @Chuka Okoye
    – JohnDoe974
    Nov 16 at 10:36










  • Glad I could help
    – Chuka Okoye
    Nov 17 at 11:45













up vote
0
down vote



accepted







up vote
0
down vote



accepted






Try these.



1, Change your opening form tag to this:



<form class="gform pure-form pure-form-stacked" id="google_form_submit">


2, Add the following to your code before the closing body tag



<script type="text/javascript">
$('#google_form_submit').submit(function(e){
e.preventDefault();
var formData = $('#google_form_submit').serialize();
$.ajax({
type : 'POST',
url : 'https://script.google.com/macros/s/AKfycbzBvgWZZUgFbxCAlhPG4429wth61Rm7kymPaui3d5328UHHOiA/exec',
data : formData,
dataType : 'json',
encode : true
}).done(function(data) {
if(data.result == 'success') {
// Form submission was successful and accepted by google.
// You can show your success message here

} else {
// Form was submission failed for some reasons.
// You can examine the response from google to see whats missing

}
}).fail(function (jqXHR,status,err) {
// Form submission failed due to some network or other errors
// I am alerting the error but you can do anything else with it
alert(err);
});
});
</script>


Pardon my untidy codes... am posting the answer from a tablet.
If you see any thing wrong let me know so I can fix






share|improve this answer












Try these.



1, Change your opening form tag to this:



<form class="gform pure-form pure-form-stacked" id="google_form_submit">


2, Add the following to your code before the closing body tag



<script type="text/javascript">
$('#google_form_submit').submit(function(e){
e.preventDefault();
var formData = $('#google_form_submit').serialize();
$.ajax({
type : 'POST',
url : 'https://script.google.com/macros/s/AKfycbzBvgWZZUgFbxCAlhPG4429wth61Rm7kymPaui3d5328UHHOiA/exec',
data : formData,
dataType : 'json',
encode : true
}).done(function(data) {
if(data.result == 'success') {
// Form submission was successful and accepted by google.
// You can show your success message here

} else {
// Form was submission failed for some reasons.
// You can examine the response from google to see whats missing

}
}).fail(function (jqXHR,status,err) {
// Form submission failed due to some network or other errors
// I am alerting the error but you can do anything else with it
alert(err);
});
});
</script>


Pardon my untidy codes... am posting the answer from a tablet.
If you see any thing wrong let me know so I can fix







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 at 12:06









Chuka Okoye

1223




1223












  • Thank you @Chuka Okoye
    – JohnDoe974
    Nov 16 at 10:36










  • Glad I could help
    – Chuka Okoye
    Nov 17 at 11:45


















  • Thank you @Chuka Okoye
    – JohnDoe974
    Nov 16 at 10:36










  • Glad I could help
    – Chuka Okoye
    Nov 17 at 11:45
















Thank you @Chuka Okoye
– JohnDoe974
Nov 16 at 10:36




Thank you @Chuka Okoye
– JohnDoe974
Nov 16 at 10:36












Glad I could help
– Chuka Okoye
Nov 17 at 11:45




Glad I could help
– Chuka Okoye
Nov 17 at 11:45


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53212327%2fbad-html-contact-form-redirecting-to-script-googleusercontent-com-after-submissi%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Landwehr

Reims

Schenkenzell