Git Product home page Git Product logo

google-sheet-web-form's Introduction

Google Sheet & WebForm

Save Web/HTML Form Data to Google Sheets

GitHub

Steps

A. Form (HTML)

  1. Import Script to your HTML File
<script src="Relative/path/to/WebForm.js"></script>  <!-- Inside <head> -->
  1. Make your desired form
<form method="post" autocomplete="off" name=<FORM_NAME>>
      <input type="email" title="Type your email address" id="email" name="EMAIL" placeholder="Your Email Address" required>
      <textarea id="message" title="Type your Message" name="MESSAGE" placeholder="Your Message ..." required></textarea>
      <input type="submit" title="Send your Message" value="Send">
</form>
  1. Change the <FORM_NAME> to your desired name
  2. All Form Elements must have names in Block Letters

B. Google Sheet

  1. Goto Google Sheet and create a blank sheet
  2. Name the Fields as needed in your Form in Block Letters
  3. Number of Fields must be as same as the Fields of your Form
  4. go to Tools > Script Editor
  5. Copy and paste the file WebForm.gs to the Script Editor
  6. Change the <SHEET_NAME> with your sheet name
  7. deploy and copy the <DEPLOYMENT_ID>

C. Form (JS)

  1. Add the Script to Your HTML file
document.addEventListener('submit',e=>{
    e.preventDefault(); //to stop the form being post
    var w = new WebForm(<DEPLOYMENT_ID>,<FORM_NAME>);//create an object
    w.submit(); // call to submit data
        })
  1. Change <DEPLOYMENT_ID> and <FORM_NAME> with yours

*NB:

  1. Names of Form Elements should be as same as field names of Google Sheet
  2. All Names are case sensitive, It is recommended to make them in Block letter

Caution

  1. There are no Guarantee of Security
  2. There are some quotas of Google Sheet. So it is not for your next Big Tech type website

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.