dqan70724 2015-07-21 11:03
浏览 58
已采纳

如何使用谷歌表单从textareas提交多页用户输入数据?

Right now, I have multiple pages in my website that require user input paragraphs. Basically a quiz, users fill out a paragraph and click next to go to the next page, where they do the same.

I am using google forms to do so. I have taken the code from the source code. When a user submits one page, the forms record that answer and work fine. However, I'd like one submit button. When I do this, the google forms do not keep the inputs after the user leaves the page.

How can I have google forms on each page of my website and one submit button at the end?

I'm sure there is some way to use php but i'm not familiar with php at all, I'd like to stick with google docs.

<div class="page">
    <p>whole bucnh of stuff</p>
        <div class="quesone">
            <p>Question</p>

            <form action="MY-GOOGLEDOC-LINK" method="POST" id="ss-form" target="_self" onsubmit=""><ol role="list" class="ss-question-list" style="padding-left: 0">

                <div class="ss-form-question errorbox-good" role="listitem">
                <div dir="ltr" class="ss-item  ss-paragraph-text"><div class="ss-form-entry">
                <label class="ss-q-item-label" for="entry_1389428292"><div class="ss-q-title">ques 1
                </div>
                <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
                <textarea name="entry.1389428292" rows="8" cols="0" class="ss-q-long" id="entry_1389428292" dir="auto" aria-label="ques 1  "></textarea>
                <div class="error-message" id="93637676_errorMessage"></div>
            </div></div></div></div></form>

        </div>

        <div class="questwo">
            <p>Question</p>

            <form action="SAME-GOOGLEDOC-LINK" method="Post" id="ss-form" target="_self" onsubmit=""><ol role="list" class="ss-question-list" style="padding-left: 0">

                <div class="ss-form-question errorbox-good" role="listitem">
                <div dir="ltr" class="ss-item  ss-paragraph-text"><div class="ss-form-entry">
                <label class="ss-q-item-label" for="entry_800521984"><div class="ss-q-title">ques 2
                </div>
                <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label>
                <textarea name="entry.800521984" rows="8" cols="0" class="ss-q-long" id="entry_800521984" dir="auto" aria-label="ques 2  "></textarea>
                <div class="error-message" id="1771597426_errorMessage"></div>
            </div></div></div></div></form>

        </div>

This is what my code looks like on each page of my website. Here is what my submit button on the last page looks like:

<form action="SAME-GOOGLEDOC-LINK" method="POST" id="ss-form" target="_self" onsubmit=""><ol role="list" class="ss-question-list" style="padding-left: 0">

        <input type="hidden" name="draftResponse" value="[,,&quot;-6067873700707440617&quot;]
        ">
        <input type="hidden" name="pageHistory" value="0">

        <input type="hidden" name="token" value="DpdKrU4BAAA.cBu0TrL7ZVMA6-GJ7Dn4Vw.BBwYcdE16jIxlc5c1a9l3w">
        <input type="hidden" name="fbzx" value="-6067873700707440617">
        <div class="ss-send-email-receipt" style="margin-bottom: 4px;" dir="ltr"><label for="emailReceipt" style="display:inline;"><input type="checkbox" name="emailReceipt" value="true" id="emailReceipt" checked>
        Send me a copy of my responses.</label></div>
        <div class="ss-item ss-navigate"><table id="navigation-table"><tbody><tr><td class="ss-form-entry goog-inline-block" id="navigation-buttons" dir="ltr">
        <input type="submit" name="submit" value="Submit" id="ss-submit" class="jfk-button jfk-button-action ">
        <div class="ss-password-warning ss-secondary-text">Never submit passwords through Google Forms.</div></td>
        </tr></tbody></table></div></ol></form>

I just want all my data to be submitted on the last page so that when the user submits, they receive only one email containing all their answers from the google forms. If there is any easier way to do this let me know!

展开全部

  • 写回答

1条回答 默认 最新

  • dqhr76378 2015-07-21 11:20
    关注

    What you are talking about is persisting application state across multiple page views. Since HTTP is by design a stateless protocol, you must use one of several other methods to persist state. These methods include:

    • Session storage
    • Cookies
    • HTML5 localStorage
    • HTML5 sessionStorage
    • Passing parameters in URL

    Which to use can depend on a lot of factors including information security, whether you need to persist data across sessions, etc. Unfortunately, the question itself is probably too broad and may be closed, but I at least wanted to give you a better explanation as to why than would be allowed in a short comment.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部