如何使用JavaScript将数据从HTML表单发送到Google Spreadsheet? [英] How to send data from HTML form to Google Spreadsheet using JavaScript?

查看:214
本文介绍了如何使用JavaScript将数据从HTML表单发送到Google Spreadsheet?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个web应用程序,用于记录Google Spreadsheet中的表单中的数据。为此,我使用JavaScript(JSON或AJAX请求也可以),但我不能使用Google Apps脚本,因为我需要用户继续使用我的网页和GAS不允许它。



我对JSON请求不太熟悉,但我试图做一个追加:毫不奇怪,它不工作,没有意外,我不知道为什么。



我不确定我用来发出请求和代码的URL是否正确,但不知道如何继续,很难知道我的代码中有什么问题。



这是我的表单:

 < form name =reqFormid =reqFormmethod =postaction =accept-charset =UTF-8enctype =application / json> 
< input type =hiddenname =areaid =areareadonly />
< input type =hiddenname =idNid =idNreadonly />
< input type =hiddenname =dataReqid =dataReqreadonly />
< label for =nome> * Nome:< / label>
< input type =textid =nomename =nomeplaceholder =Il tuo nome/>
< label for =cognome> * Cognome:< / label>
< input type =textid =cognomename =cognomeplaceholder =Il tuo cognome/>
< label for =mat> * Matricola:< / label>
< input type =textid =matname =matplaceholder =La tua matricola/>
< label for =mail> *电子邮件:< / label>
< input type =textid =mailname =mailplaceholder =La tua e-mail/>
< label for =testo> * Richiesta:< / label>