Solution 1 :

Try this:

  1. run the openDialog() function after filling in serverfunctionname and htmlfilename.

Your html:

<!DOCTYPE html>
<html>

<head>
  <base target="_top">
</head>

<body>
  <p style="font-family:verdana;font-size:15px">Problem title</p>
  <input type="text" id="sDes"> <br><br>
  <p style="font-family:verdana;font-size:15px">Decription</p>
  <textarea style="resize: none;" rows="8" cols="63" id="lDes"></textarea>
  <button type="button" onclick="myFunction()">Send</button>
  <p id="demo"></p>
</body>
<script>
  function myFunction() {
    var a = document.getElementById("sDes").value;
    var b = document.getElementById("lDes").value;
    google.script.run.serverfunctionname(a,b);//modification
  }
</script>

</html>

GS:

function serverfunctioname(x,y) {
  SpreadsheetApp.getUi().alert('I received ' + x + ' and ' + y);
}


function openDialog() {
  SpreadsheetApp.getUi().showModelessDialog(HtmlService.createHtmlOutputFromFile('htmlfilename'), "My Dialog")
}

Problem :

I’m writing some to get the user’s input in a text area and then to pass it to google app scripts to my main google script to email it on. I also tried to pass them through the project properties with no luck.

<!DOCTYPE html>
<html>

<head>
  <base target="_top">
</head>

<body>
  <p style="font-family:verdana;font-size:15px">Problem title</p>
  <input type="text" id="sDes"> <br><br>
  <p style="font-family:verdana;font-size:15px">Decription</p>
  <textarea style="resize: none;" rows="8" cols="63" id="lDes"></textarea>
  <button type="button" onclick="myFunction()">Send</button>
  <p id="demo"></p>
</body>
<script>
  function myFunction() {
    var a = document.getElementById("sDes").value;
    var b = document.getElementById("lDes").value;
  }
</script>

</html>

Comments

Comment posted by google.script.run

Unfortunately, from your question, I’m not sure about your issue. When your HTML is included in the Google Apps Script project, you can achieve your goal using

By