Background: I have prepared a form in HTML Service in Google apps script which I call with DoGet function from Code.gs.
my doget function
function doGet() {
return HtmlService.createTemplateFromFile('HTMLUI').evaluate();
}
Once published it presents a simple browser form with some labels, input box, submit, reset and find buttons on it. The user(s) will input information click submit and the data will get stored in a spreadsheet (background). - Working fine till here.
Now when the user clicks find button - a popup kind of window needs to populated, in this popup user can enter information (from a dropdown) and the selected entry would be populated back in the input boxes which can be amended and submitted again.
Question:
How can I have a POP up kind off window in GAS when on browser.
my find button in HTML service is as follows:
<div><input type="button" onclick="createPopup()" value="Find"></div>
in end for calling the javascript:
<script type="text/javascript">
function createPopup() {
google.script.run.popup(document.forms[0]);
}
</script>
the CreatePopup()javascript code:
function popup(form){
Logger.log("I am first called");
//Mycode should probably go here I think...
Logger.log("I am last called");
}
When the log is viewed it shows "I am first called" and "I am last called".
My research: I found that the Spreadsheet.toast (something like this) works on spreadsheet, but how do I get the small window on browser..