-
Notifications
You must be signed in to change notification settings - Fork 0
/
StartPage.html
38 lines (34 loc) · 986 Bytes
/
StartPage.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
<!DOCTYPE html>
<html>
<head>
<script>
// Prevent forms from submitting.
function preventFormSubmit() {
var forms = document.querySelectorAll('form');
for (var i = 0; i < forms.length; i++) {
forms[i].addEventListener('submit', function(event) {
event.preventDefault();
});
}
}
window.addEventListener('load', preventFormSubmit);
function handleFormSubmit(formObject) {
google.script.run.withSuccessHandler(updateComputation).processForm(formObject);
}
function updateComputation(computation) {
var div = document.getElementById('output');
div.innerHTML = computation;
}
</script>
</head>
<body>
<form id="myForm" onsubmit="handleFormSubmit(this)">
Starting array value
<input type="text" name="startVal"><br/>
<input type="submit" value="Generate Computation"/>
</form>
<div id="output">
computation here
</div>
</body>
</html>