admin管理员组文章数量:1024885
So, I have a client that wants to use Google Forms for a form on their website. They also want the user to be able to download some resources after successfully submitting the form. The problem is that the Google form has to be embedded with an iframe, so I can't find a way to check if the form has been submitted since it's happening within the iframe.
The mark up would be like this:
<div>
<iframe
src="
YeVFUNY0slXBP4kQ/viewform?embedded=true" id="googleForm" width="760" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...
</iframe>
</div>
My question is: is there any way at all to check if the form was submitted, via jQuery, plain Javascript or anything else? Or, is there any script, or settings I can use within Google Forms to feed the user custom HTML after submitting the form?
So, I have a client that wants to use Google Forms for a form on their website. They also want the user to be able to download some resources after successfully submitting the form. The problem is that the Google form has to be embedded with an iframe, so I can't find a way to check if the form has been submitted since it's happening within the iframe.
The mark up would be like this:
<div>
<iframe
src="https://docs.google./forms/d/e/1FAIpQLSdtWuGTwEZEoqJAo0TXJt0LIMSO4g0Mot
YeVFUNY0slXBP4kQ/viewform?embedded=true" id="googleForm" width="760" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...
</iframe>
</div>
My question is: is there any way at all to check if the form was submitted, via jQuery, plain Javascript or anything else? Or, is there any script, or settings I can use within Google Forms to feed the user custom HTML after submitting the form?
Share Improve this question asked Oct 7, 2017 at 3:04 Clay WhaleyClay Whaley 431 gold badge1 silver badge7 bronze badges2 Answers
Reset to default 1So the solution that I found came from this post: https://codepen.io/learningcode/post/customize-a-google-form-for-your-website
What you do is make your own form, and then add in the form actions from the Google Form (basically; I'm not positive on how it works but it does).
For example, the beggining of the form would look like this:
<form action="https://docs.google./forms/d/e/someotherlettersfromthegoogleform/formResponse">
<label for="FNAME">First Name</label>
<input name="entry.1499702011" type="text" id="FNAME" />
<label for="LNAME">Last Name</label>
<input name="entry.738838864" type="text" id="LNAME" />
</form>
Now, the Google Form is actually on the website, not embedded with an iframe, so I should be able to find a way to redirect the page or use a pop or something with the download links. I hope this answer can help out someone else who runs into this.
I'm not exactly sure what your client is trying to achieve but the only thing that es to my mind is to use dedicated download links with landing page that triggers some action on your client website with AJAX. Well I know it's not the same as knowing whether client only submitted or submitted and downloaded the file but there's not much you can do anyway. Please correct me if im wrong.
So, I have a client that wants to use Google Forms for a form on their website. They also want the user to be able to download some resources after successfully submitting the form. The problem is that the Google form has to be embedded with an iframe, so I can't find a way to check if the form has been submitted since it's happening within the iframe.
The mark up would be like this:
<div>
<iframe
src="
YeVFUNY0slXBP4kQ/viewform?embedded=true" id="googleForm" width="760" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...
</iframe>
</div>
My question is: is there any way at all to check if the form was submitted, via jQuery, plain Javascript or anything else? Or, is there any script, or settings I can use within Google Forms to feed the user custom HTML after submitting the form?
So, I have a client that wants to use Google Forms for a form on their website. They also want the user to be able to download some resources after successfully submitting the form. The problem is that the Google form has to be embedded with an iframe, so I can't find a way to check if the form has been submitted since it's happening within the iframe.
The mark up would be like this:
<div>
<iframe
src="https://docs.google./forms/d/e/1FAIpQLSdtWuGTwEZEoqJAo0TXJt0LIMSO4g0Mot
YeVFUNY0slXBP4kQ/viewform?embedded=true" id="googleForm" width="760" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...
</iframe>
</div>
My question is: is there any way at all to check if the form was submitted, via jQuery, plain Javascript or anything else? Or, is there any script, or settings I can use within Google Forms to feed the user custom HTML after submitting the form?
Share Improve this question asked Oct 7, 2017 at 3:04 Clay WhaleyClay Whaley 431 gold badge1 silver badge7 bronze badges2 Answers
Reset to default 1So the solution that I found came from this post: https://codepen.io/learningcode/post/customize-a-google-form-for-your-website
What you do is make your own form, and then add in the form actions from the Google Form (basically; I'm not positive on how it works but it does).
For example, the beggining of the form would look like this:
<form action="https://docs.google./forms/d/e/someotherlettersfromthegoogleform/formResponse">
<label for="FNAME">First Name</label>
<input name="entry.1499702011" type="text" id="FNAME" />
<label for="LNAME">Last Name</label>
<input name="entry.738838864" type="text" id="LNAME" />
</form>
Now, the Google Form is actually on the website, not embedded with an iframe, so I should be able to find a way to redirect the page or use a pop or something with the download links. I hope this answer can help out someone else who runs into this.
I'm not exactly sure what your client is trying to achieve but the only thing that es to my mind is to use dedicated download links with landing page that triggers some action on your client website with AJAX. Well I know it's not the same as knowing whether client only submitted or submitted and downloaded the file but there's not much you can do anyway. Please correct me if im wrong.
本文标签: javascriptHow to check if Google form was submittedStack Overflow
版权声明:本文标题:javascript - How to check if Google form was submitted? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745503215a2153485.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论