title: InvalidArgumentError: Failed due to illegal value in property: 0
body: <p>I am trying to program a geography quiz and it doesn't seem to work. Whenever I try to click the 'Submit' button, it prints out <code>InvalidArgumentError: Failed due to illegal value in property: 0</code>. do you have any ideas why this might be? Thanks in advance.</p>
  
  <hr>
  
  <p>HTML:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
      &lt;html&gt;
          &lt;head&gt;
              &lt;base target="_top"&gt;
              &lt;script&gt;
                  function send() {
                      var q1 = document.getElementById("q1").value;
                      var q2 = document.getElementById("q2").value;
                      var q3 = document.getElementById("q3").value;
                      var q4 = document.getElementById("q4").value;
                      var q5 = document.getElementById("q5").value;
                      var q6 = document.getElementById("q6").value;
                      var q7 = document.getElementById("q7").value;
                      var q8 = document.getElementById("q8").value;
                      var Email = document.getElementById("EmailAddress");
                      var Result = ("Results: 1. " + q1 + " 2. " + q2 + " 3. " + q3 + " 4. " + q4 + " 5. " + q5 + " 6. " + q6 + " 7. " + q7 + " 8. " + q8);
                      google.script.run.send(Email, Result);
                  }
              &lt;/script&gt;
              &lt;script src="https://ws.sharethis.com/button/buttons.js"&gt;
              &lt;/script&gt;
              &lt;script&gt;
                  stLight.options({
                   publisher: "a788dcd1-6dfb-49ee-ba6c-3b6822d69fd8",
                   doNotHash: false,
                   doNotCopy: false,
                   hashAddressBar: false
                  });
              &lt;/script&gt;
              &lt;style&gt;
                  .myButton {
                      -moz-box-shadow: inset 0px 39px 0px -24px #e67a73;
                      -webkit-box-shadow: inset 0px 39px 0px -24px #e67a73;
                      box-shadow: inset 0px 39px 0px -24px #e67a73;
                      background-color: #e4685d;
                      -moz-border-radius: 4px;
                      -webkit-border-radius: 4px;
                      border-radius: 4px;
                      border: 1px solid #ffffff;
                      display: inline-block;
                      cursor: pointer;
                      color: #ffffff;
                      font-family: Arial;
                      font-size: 15px;
                      padding: 6px 15px;
                      text-decoration: none;
                      text-shadow: 0px 1px 0px #b23e35;
                  }
                  .myButton:hover {
                      background-color: #eb675e;
                  }
                  .myButton:active {
                      position: relative;
                      top: 1px;
                  }
                  .myButton2 {
                      -moz-box-shadow: inset 0px -3px 7px 0px #29bbff;
                      -webkit-box-shadow: inset 0px -3px 7px 0px #29bbff;
                      box-shadow: inset 0px -3px 7px 0px #29bbff;
                      background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #2dabf9), color-stop(1, #0688fa));
                      background: -moz-linear-gradient(top, #2dabf9 5%, #0688fa 100%);
                      background: -webkit-linear-gradient(top, #2dabf9 5%, #0688fa 100%);
                      background: -o-linear-gradient(top, #2dabf9 5%, #0688fa 100%);
                      background: -ms-linear-gradient(top, #2dabf9 5%, #0688fa 100%);
                      background: linear-gradient(to bottom, #2dabf9 5%, #0688fa 100%);
                      filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#2dabf9', endColorstr='#0688fa', GradientType=0);
                      background-color: #2dabf9;
                      -moz-border-radius: 3px;
                      -webkit-border-radius: 3px;
                      border-radius: 3px;
                      border: 1px solid #9591ff;
                      display: inline-block;
                      cursor: pointer;
                      color: #ffffff;
                      font-family: Arial;
                      font-size: 15px;
                      padding: 6px 23px;
                      text-decoration: none;
                      text-shadow: 0px 1px 0px #263666;
                  }
                  .myButton2:hover {
                      background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #0688fa), color-stop(1, #2dabf9));
                      background: -moz-linear-gradient(top, #0688fa 5%, #2dabf9 100%);
                      background: -webkit-linear-gradient(top, #0688fa 5%, #2dabf9 100%);
                      background: -o-linear-gradient(top, #0688fa 5%, #2dabf9 100%);
                      background: -ms-linear-gradient(top, #0688fa 5%, #2dabf9 100%);
                      background: linear-gradient(to bottom, #0688fa 5%, #2dabf9 100%);
                      filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#0688fa', endColorstr='#2dabf9', GradientType=0);
                      background-color: #0688fa;
                  }
                  .myButton2:active {
                      position: relative;
                      top: 1px;
                  }
              &lt;/style&gt;
          &lt;/head&gt;
          &lt;body&gt;
              &lt;font face="Verdana"&gt;
                  &lt;h1&gt;
                      Geography Quiz
                  &lt;/h1&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  Your teacher's email address:
                  &lt;input type="text" id="EmailAddress"/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  &lt;b&gt;
                      Questions
                  &lt;/b&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  Q (1): Which state has a climate suitable for growing citrus fruits—California or Maine?
                  &lt;br/&gt;
                  A:
                  &lt;input type="text" id="q1"/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  Q (2): The North Atlantic current brings warm waters from the tropics to the west coast of which continent?
                  &lt;br/&gt;
                  A:
                  &lt;input type="text" id="q2"/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  Q (3): Which Canadian province produces more than half of the country's manufactured goods?
                  &lt;br/&gt;
                  A:
                  &lt;input type="text" id="q3"/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  Q (4): To visit the ruins of Persepolis, an ancient ceremonial capital of Persia, you would have to travel to what present-day country?
                  &lt;br/&gt;
                  A:
                  &lt;input type="text" id="q4"/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  Q (5): What is the term for a part of an ocean or sea that cuts far into the bordering landmass and may contain one or more bays?
                  &lt;br/&gt;
                  A:
                  &lt;input type="text" id="q5"/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  Q (6): Which country has the world's largest Muslim population—Indonesia or Mexico?
                  &lt;br/&gt;
                  A:
                  &lt;input type="text" id="q6"/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  Q (7): The Rio Hondo forms a boundary between Mexico and which other country?
                  &lt;br/&gt;
                  A:
                  &lt;input type="text" id="q7"/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  Q (8): Which lake is on the border between Chad and Cameroon?
                  &lt;br/&gt;
                  A:
                  &lt;input type="text" id="q8"/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  &lt;button onclick="send(); document.write('Thanks! Your teacher will receive your results in an email.')" class="myButton"&gt;
                      Submit
                  &lt;/button&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  &lt;span class='st_facebook_hcount'&gt;
                  &lt;/span&gt;
                  &lt;span class='st_twitter_hcount'&gt;
                  &lt;/span&gt;
                  &lt;span class='st_googleplus_hcount'&gt;
                  &lt;/span&gt;
                  &lt;br/&gt;
                  &lt;br/&gt;
                  &lt;footer&gt;
                      &lt;font size="1px"&gt;
                          Posted by: Yona Klatchko | Contact information:
                          &lt;a href="mailto:yona.klatchko@gmail.com"&gt;
                              yona.klatchko@gmail.com
                          &lt;/a&gt;
                      &lt;/font&gt;
                  &lt;/footer&gt;
              &lt;/font&gt;
          &lt;/body&gt;
      &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <hr>
  
  <p>Google-Apps-Script doGet() function:</p>
  
  <pre><code>function doGet() {
      return(HtmlService.createTemplateFromFile('Index.html').evaluate().setTitle('Geography Quiz').setSandboxMode(HtmlService.SandboxMode.IFRAME)); 
  }
  </code></pre>
  
  <hr>
  
  <p>Google-Apps-Script send() function:</p>
  
  <pre><code>function send(Email, Result) {
      MailApp.sendEmail(Email, Result);
  }
  </code></pre>
  
  <hr>