-
Notifications
You must be signed in to change notification settings - Fork 0
/
SampleCustomDialog.html
43 lines (41 loc) · 1.16 KB
/
SampleCustomDialog.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<h3>追加処理を行います。</h3>
<div>
<p>追加したい内容を記入してください</p>
<input type='text' id='inputText'/>
<input type='hidden' id='startDate' value='<?= startDate ?>'/>
</div>
<div>
<input type='button' value="OK" onClick='procOK()' />
<input type='button' value="キャンセル" onClick='procCancel()' />
</div>
<script>
function onFailure(error) {
alert(error.message);
google.script.host.close();
}
function onSuccess() {
google.script.host.close();
}
function procOK() {
var elm = document.getElementById('inputText');
var stdt = document.getElementById('startDate');
google.script.run
.withFailureHandler(onFailure)
.withSuccessHandler(onSuccess)
.onOkButtonClick(stdt.value, elm.value);
}
function procCancel() {
google.script.run
.withFailureHandler(onFailure)
.withSuccessHandler(onSuccess)
.onCancelButtonClick();
}
</script>
</body>
</html>