Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-11-2012, 04:52 PM   PM User | #1
Rain Lover
Regular Coder

 
Join Date: Nov 2009
Posts: 138
Thanks: 9
Thanked 0 Times in 0 Posts
Rain Lover is an unknown quantity at this point
Redirect a Google Docs form to your custom 'thank you' page

Here's a Google Docs form:

Code:
<form action="https://docs.google.com/spreadsheet/formResponse?formkey=dE02TlBHQ2hnVVdkTE5ya0lBYXhaMlE6MQ&amp;ifq" method="POST" id="ss-form">
<br>
<div class="errorbox-good">
<div class="ss-item ss-item-required ss-text"><div class="ss-form-entry"><label class="ss-q-title" for="entry_0">First name
<span class="ss-required-asterisk">*</span></label>
<label class="ss-q-help" for="entry_0"></label>
<input type="text" name="entry.0.single" value="" class="ss-q-short" id="entry_0"></div></div></div>
<br> <div class="errorbox-good">
<div class="ss-item ss-item-required ss-text"><div class="ss-form-entry"><label class="ss-q-title" for="entry_1">Last name
<span class="ss-required-asterisk">*</span></label>
<label class="ss-q-help" for="entry_1"></label>
<input type="text" name="entry.1.single" value="" class="ss-q-short" id="entry_1"></div></div></div>
<br>
<input type="hidden" name="pageNumber" value="0">
<input type="hidden" name="backupCache" value="">
<div class="ss-item ss-navigate"><div class="ss-form-entry">
<input type="submit" name="submit" value="Submit"></div></div></form>
And here's the spreadsheet that it feeds:
https://docs.google.com/spreadsheet/...E5ya0lBYXhaMlE

I wonder how to redirect the form to my own custom 'thank you' page on submission.
Thanks!
Rain Lover is offline   Reply With Quote
Old 10-12-2012, 02:22 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 361 Times in 360 Posts
sunfighter is on a distinguished road
Code:
<form action="https://docs.google.com/spreadsheet/formResponse?formkey=dE02TlBHQ2hnVVdkTE5ya0lBYXhaMlE6MQ&amp;ifq"
The action attribute sets the destination of the form inputs. Change that to call your 'thank you' page which should be a php file. Read this for starters: http://www.w3schools.com/php/php_post.asp
sunfighter is offline   Reply With Quote
Old 10-12-2012, 04:08 PM   PM User | #3
Rain Lover
Regular Coder

 
Join Date: Nov 2009
Posts: 138
Thanks: 9
Thanked 0 Times in 0 Posts
Rain Lover is an unknown quantity at this point
Quote:
Originally Posted by sunfighter View Post
The action attribute sets the destination of the form inputs. Change that to call your 'thank you' page which should be a php file.
Thanks for the answer, but it prevents the Google form to send the information to the spreadsheet.
Rain Lover is offline   Reply With Quote
Old 10-13-2012, 01:41 AM   PM User | #4
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 361 Times in 360 Posts
sunfighter is on a distinguished road
There is no way I know of where you can send one form to two pages.
But we can use two buttons
Code:
<form name="f1" method="POST" id="ss-form" action="https://docs.google.com/spreadsheet/formResponse?formkey=dE02TlBHQ2hnVVdkTE5ya0lBYXhaMlE6MQ&amp;ifq">

<input type='submit' value='Send to thank you page' onclick="f1.action='ThankYou.php'; return true;">
<input type="submit" name="submit" value="Submit">

</form>
Notice the addition in red name="f1"

Last edited by sunfighter; 10-13-2012 at 01:50 AM..
sunfighter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:23 AM.


Advertisement
Log in to turn off these ads.