如何使用谷歌表单从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个回答



您所说的是跨多个页面视图保持应用程序状态。 由于HTTP是设计上的无状态协议,因此必须使用其他几种方法之一来保持状态。 这些方法包括:</ p>


  • 会话存储</ li>
  • Cookie </ li>
  • HTML5 localStorage </ li>
    < li> HTML5 sessionStorage </ li>
  • 在URL中传递参数</ li>
    </ ul>

    使用哪个可能取决于很多因素,包括信息安全性,是否 需要在会话间保持数据等。不幸的是,这个问题本身可能过于宽泛而且可能会被关闭,但我至少想要给你一个更好的解释,为什么比简短的评论更容易被允许。</ p>

    </ div>

展开原文

原文

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.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐