Greetings. I have html as filename searchbox.html
the
usual way to call is by return
HtmlService.createHtmlOutputFromFile('searchbox').setSandboxMode(HtmlService.SandboxMode.IFRAME);
but of course return closes the script; I need to continue the script after the variable "q" is returned.
Can
anyone enlighten me how to get the html script to run and return the
value without having to use return (which instantiates, then closes the
routine).
//searchbox.html
<!DOCTYPE html>
<html>
<form>
<input type="search" id="q" name="submit" placeholder="Search for song name..." required>
<button onclick="bclick(q.value)">Search</button />
</form>
<script type="text/javascript">
function bclick(q) {
return q; //document.write("Search Field = " + q + "<br><br>");
}
</script>
</html>
Which is called from here:
function doGet(e) {
e
=
HtmlService.createHtmlOutputFromFile('searchbox').setSandboxMode(HtmlService.SandboxMode.IFRAME);
//this does not return the html
return
HtmlService.createHtmlOutputFromFile('searchbox').setSandboxMode(HtmlService.SandboxMode.IFRAME);//
works, but on return script ends
//code continues
var gotResults = getDriveFiles(DriveApp.getFolderById('1e9aI6k3vn3n4oI1wFewdK3NarsaCnapH'),e);