FORMDIALOG

Note

Browser Side Script

The script generates a dialog box Update existing Kobo forms

 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
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<style>
title {color: navy;}
p { margin-left: 0pt; margin-top: 5pt;margin-bottom: 5pt;color: navy; font: 16px bold, Arimo; }
pp { display:inline-block; margin-left: 10pt; margin-top: 5pt;margin-bottom: 5pt;color: black; font: 15px bold, Arimo; }
label{margin-bottom: 5pt;margin-right: 5pt;font: 15px normal, Arimo; }
div {margin-left: 10pt; margin-top: 5pt;margin-bottom: 5pt;}
input{color: black; font: 16px bold, Arimo; }
</style>
</head>

<script>
var r;
var year;
var formid;
var title2;
google.script.run.withSuccessHandler(onSuccess).changerow2();
function onSuccess(numUnread) {
var div = document.getElementById('year');
div.innerHTML = 'YEAR: ' + numUnread[0];
year=numUnread[0];
var div = document.getElementById('title');
div.innerHTML = 'TITLE: ' + numUnread[1];
title2=String(numUnread[1]);
var div = document.getElementById('formid');
div.innerHTML = 'FORM ID: ' + numUnread[2];
formid=numUnread[2];
r=numUnread[3];
}

</script>

<body>
<p>1. SELECT<p>
<pp id="title"></pp>
<pp id="year"></pp>
<pp id="formid"></pp><br>

<div align="right"><button onclick='google.script.run.withSuccessHandler(onSuccess).changerow2(r,1)' id='button2' > ↑ </button>
<button onclick='google.script.run.withSuccessHandler(onSuccess).changerow2(r,0)' id='button2'> ↓ </button></div>

<br>

<div align="right">
<input type="button" value="SUBMIT" onclick="google.script.run.TEMPSUBMIT2(title2,year,formid);" />&nbsp;&nbsp;&nbsp;
<input type="button" value="CANCEL" onclick="google.script.host.close()" />
</div>
</body>

</html>