表单连接到Google工作表

时间:2018-11-12 11:20:06

标签: javascript jquery html forms

我使用this way制作了一个表格,但该表格无法正常工作,我已经完成了该站点中的第一步。

但是我认为问题出在我的代码上,这就是为什么它不起作用。 有人可以审查它.txs

<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <title>pag3</title>
    <link rel="stylesheet" href="css/style.css">
        <script>
    var $form = $('form#test-form'),
    url = 'https://script.google.com/macros/s/AKfycbyXod9jBus3hVXRKQTA0XgsFBRlYyUSqAgtKqqqHpoKhS-EHPX3/exec'

$('#submit-form').on('click', function(e) {
  e.preventDefault();
  var jqxhr = $.ajax({
    url: url,
    method: "GET",
    dataType: "json",
    data: $form.serializeObject()
  }).success(
    // do something
  );
})
    </script>
</head>

<body>
     <form id="test-form">
  <h1>Como classifica a RAPIDEZ do atendimento? </h1>
  <div>
    <label>Fraco</label>
    <a href="index5.html">
            <input type="image" name="RAPIDEZ_atendimento" id="submit-form" alt="Fraco" placeholder="Field 3"
       src="img/sad.png">    
            </a>
  </div>

  <div>
    <label>Normal</label>
    <a href="index5.html">
            <input type="image" name="RAPIDEZ_atendimento" id="submit-form" alt="Normal" placeholder="Field 3"
       src="img/confused.png">    
            </a>
  </div>
  
  <div>
   <label>Bom</label>
    <a href="index5.html">
            <input type="image" name="RAPIDEZ_atendimento" id="submit-form" alt="Bom" placeholder="Field 3"
       src="img/smiling.png">    
            </a>
  </div>
  
  <div>
   <label>Muito Bom</label>
    <a href="index5.html">
            <input type="image" name="RAPIDEZ_atendimento" id="submit-form" alt="Muito Bom" placeholder="Field 3"
       src="img/happy.png">    
            </a>
  </div>

</form>

</body>

</html>
<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <title>pag2</title>
    <link rel="stylesheet" href="css/style.css">
        <script>
    var $form = $('form#test-form'),
    url = 'https://script.google.com/macros/s/AKfycbyXod9jBus3hVXRKQTA0XgsFBRlYyUSqAgtKqqqHpoKhS-EHPX3/exec'

$('#submit-form').on('click', function(e) {
  e.preventDefault();
  var jqxhr = $.ajax({
    url: url,
    method: "GET",
    dataType: "json",
    data: $form.serializeObject()
  }).success(
    // do something
  );
})
    </script>
</head>

<body>
     <form id="test-form">
  <h1>Como classifica a VARIEDADE dos nossos produtos?</h1>
  <div>
    <label>Fraco</label>
    <a href="index4.html">
            <input type="image" name="VARIEDADE_produtos" id="submit-form" alt="Fraco" placeholder="Field 2"
       src="img/sad.png">    
            </a>
  </div>

  <div>
    <label>Normal</label>
    <a href="index4.html">
            <input type="image" name="VARIEDADE_produtos" id="submit-form" alt="Normal" placeholder="Field 2"
       src="img/confused.png">    
            </a>
  </div>
  
  <div>
   <label>Bom</label>
    <a href="index4.html">
            <input type="image" name="VARIEDADE_produtos" id="submit-form" alt="Bom" placeholder="Field 2"
       src="img/smiling.png">    
            </a>
  </div>
  
  <div>
   <label>Muito Bom</label>
    <a href="index4.html">
            <input type="image" name="VARIEDADE_produtos" id="submit-form" alt="Muito Bom" placeholder="Field 2"
       src="img/happy.png">    
            </a>
  </div>

</form>

</body>

</html>
<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <title>pag1</title>
    <link rel="stylesheet" href="css/style.css">
    <script>
    var $form = $('form#test-form'),
    url = 'https://script.google.com/macros/s/AKfycbyXod9jBus3hVXRKQTA0XgsFBRlYyUSqAgtKqqqHpoKhS-EHPX3/exec'

$('#submit-form').on('click', function(e) {
  e.preventDefault();
  var jqxhr = $.ajax({
    url: url,
    method: "GET",
    dataType: "json",
    data: $form.serializeObject()
  }).success(
    // do something
  );
})
    </script>
</head>

<body>
    <form id="test-form">
  <h1>Como classifica a QUALIDADE dos nossos produtos?</h1>
  <div>
    <label>Fraco</label>
    <a href="index3.html">
            <input type="image" name="QUALIDADE_produtos" id="submit-form" alt="Fraco" placeholder="Field 1"
       src="img/sad.png">    
            </a>
  </div>

  <div>
    <label>Normal</label>
    <a href="index3.html">
            <input type="image" name="QUALIDADE_produtos" id="submit-form" alt="Normal" placeholder="Field 1"
       src="img/confused.png">    
            </a>
  </div>
  
  <div>
   <label>Bom</label>
    <a href="index3.html">
            <input type="image" name="QUALIDADE_produtos" id="submit-form" alt="Bom" placeholder="Field 1"
       src="img/smiling.png">    
            </a>
  </div>
  
  <div>
   <label>Muito Bom</label>
    <a href="index3.html">
            <input type="image" name="QUALIDADE_produtos" id="submit-form" alt="Muito Bom" placeholder="Field 1"
       src="img/happy.png">    
            </a>
  </div>

</form>

</body>

</html>

我什至无法进入第二页。它在地址栏上给出结果,我应该更改发布方法吗? 代码的最后一部分。

<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <title>pag6</title>
    <link rel="stylesheet" href="css/style.css">
        <script>
    var $form = $('form#test-form'),
    url = 'https://script.google.com/macros/s/AKfycbyXod9jBus3hVXRKQTA0XgsFBRlYyUSqAgtKqqqHpoKhS-EHPX3/exec'

$('#submit-form').on('click', function(e) {
  e.preventDefault();
  var jqxhr = $.ajax({
    url: url,
    method: "GET",
    dataType: "json",
    data: $form.serializeObject()
  }).success(
    // do something
  );
})
    </script>
</head>

<body>
     <form id="test-form">
  <h1>Para Acabar</h1>
<div>
    <label>Deixe um comentário</label>
    <input type="text" name="Deixe_comentario" placeholder="Field 6"/>
  </div>

  <div>
    <label>Contacto</label>
    <input type="text" name="Contacto_email" placeholder="Field 7"/>
    
</div>
  
  <div>
    <button type="submit" id="submit-form" onclick="location.href='index8.html';">Submit</button>
</div>

</form>

</body>

</html>
<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <title>pag5</title>
    <link rel="stylesheet" href="css/style.css">
        <script>
    var $form = $('form#test-form'),
    url = 'https://script.google.com/macros/s/AKfycbyXod9jBus3hVXRKQTA0XgsFBRlYyUSqAgtKqqqHpoKhS-EHPX3/exec'

$('#submit-form').on('click', function(e) {
  e.preventDefault();
  var jqxhr = $.ajax({
    url: url,
    method: "GET",
    dataType: "json",
    data: $form.serializeObject()
  }).success(
    // do something
  );
})
    </script>
</head>

<body>
     <form id="test-form">
  <h1>Como classifica o nosso espaço?</h1>
  <div>
    <label>Fraco</label>
    <a href="index7.html">
            <input type="image" name="nosso_espaço" id="submit-form" alt="Fraco" placeholder="Field 5"
       src="img/sad.png">    
            </a>
  </div>

  <div>
    <label>Normal</label>
    <a href="index7.html">
            <input type="image" name="nosso_espaço" id="submit-form" alt="Normal" placeholder="Field 5"
       src="img/confused.png">    
            </a>
  </div>
  
  <div>
   <label>Bom</label>
    <a href="index7.html">
            <input type="image" name="nosso_espaço" id="submit-form" alt="Bom" placeholder="Field 5"
       src="img/smiling.png">    
            </a>
  </div>
  
  <div>
   <label>Muito Bom</label>
    <a href="index7.html">
            <input type="image" name="nosso_espaço" id="submit-form" alt="Muito Bom" placeholder="Field 5"
       src="img/happy.png">    
            </a>
  </div>

</form>

</body>

</html>
<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <title>pag4</title>
    <link rel="stylesheet" href="css/style.css">
        <script>
    var $form = $('form#test-form'),
    url = 'https://script.google.com/macros/s/AKfycbyXod9jBus3hVXRKQTA0XgsFBRlYyUSqAgtKqqqHpoKhS-EHPX3/exec'

$('#submit-form').on('click', function(e) {
  e.preventDefault();
  var jqxhr = $.ajax({
    url: url,
    method: "GET",
    dataType: "json",
    data: $form.serializeObject()
  }).success(
    // do something
  );
})
    </script>
</head>

<body>
     <form id="test-form">
  <h1>E quanto à QUALIDADE do atendimento?</h1>
  <div>
    <label>Fraco</label>
    <a href="index6.html">
            <input type="image" name="QUALIDADE_atendimento" id="submit-form" alt="Fraco" placeholder="Field 4"
       src="img/sad.png">    
            </a>
  </div>

  <div>
    <label>Normal</label>
    <a href="index6.html">
            <input type="image" name="QUALIDADE_atendimentos" id="submit-form" alt="Normal" placeholder="Field 4"
       src="img/confused.png">    
            </a>
  </div>
  
  <div>
   <label>Bom</label>
    <a href="index6.html">
            <input type="image" name="QUALIDADE_atendimento" id="submit-form" alt="Bom" placeholder="Field 4"
       src="img/smiling.png">    
            </a>
  </div>
  
  <div>
   <label>Muito Bom</label>
    <a href="index6.html">
            <input type="image" name="QUALIDADE_atendimento" id="submit-form" alt="Muito Bom" placeholder="Field 4"
       src="img/happy.png">    
            </a>
  </div>

</form>

</body>

</html>

0 个答案:

没有答案