-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
36 lines (34 loc) · 1.2 KB
/
Copy pathindex.html
File metadata and controls
36 lines (34 loc) · 1.2 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TEST FORM-X</title>
<link rel="stylesheet" href="dist/FormX.min.css">
</head>
<body>
<button type="button" id="Design" class="mode">Design</button>
<button type="button" id="View" class="mode">View</button>
<button type="button" id="Assess" class="mode">Assessment</button>
<button type="button" id="Review" class="mode">Review</button>
<hr >
<div id="form_container"></div>
<script src="dist/FormX.min.js"></script>
<script>
const options = {
saveUrl: '/save',
height: 500
};
let fx = new FormX.Design('#form_container', options);
const buttons = document.querySelectorAll('.mode');
buttons.forEach(x => {
x.addEventListener('click', e => {
const formData = fx.getJson();
fx = new FormX[e.target.id]('#form_container', Object.assign({}, options, {
initialData: formData
}));
})
})
</script>
</body>
</html>