Try this:
- 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")
}