I'm using HtmlService in google sheets.
code.gs:
function openDialog() {
var html = HtmlService.createTemplateFromFile('Index')
.evaluate()
.setHeight(300);
SpreadsheetApp.getUi().showModalDialog(html, 'Dialog title');
}
Index.html:
<form>
<input type="text" name="userid" value="<? getProp(userKey,true) ?>"/>
<input type="button" value="Submit" onClick="google.script.run.withSuccessHandler().processForm(this.form)"/>
</form>
Can I somehow check if the user closes the window without clicking on my submit button? I want to force the user to provide the data.