-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
90 lines (83 loc) · 2.43 KB
/
index.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!doctype html>
<html>
<head>
<title>Form Builder</title>
<meta name="description" content="">
<link rel="stylesheet" href="vendor.css" />
<link rel="stylesheet" href="formbuilder.css" />
<style>
* {
box-sizing: border-box;
}
.fb-main {
background-color: #fff;
border-radius: 5px;
min-height: 600px;
}
input[type=text] {
height: 26px;
margin-bottom: 3px;
}
select {
margin-bottom: 5px;
font-size: 40px;
}
</style>
</head>
<body>
<div class='fb-main'></div>
<script src="vendor.js"></script>
<script src="formbuilder.js"></script>
<script>
$(function(){
fb = new Formbuilder({
selector: '.fb-main',
bootstrapData: [
{
"title": "Do you have a website?",
"view": "url",
"required": false,
"fieldOptions": {},
"cid": "field1"
},
{
"title": "Please enter your clearance number",
"view": "text",
"required": true,
"fieldOptions": {},
"cid": "field6"
},
{
"title": "Security personnel #82?",
"view": "radio",
"required": true,
"fieldOptions": {
"options": [{
"label": "Yes",
"checked": false
}, {
"label": "No",
"checked": false
}],
"include_other_option": true
},
"cid": "field10"
},
{
"title": "Medical history",
"view": "url",
"required": true,
"fieldOptions": {},
"cid": "field14"
}
],
type:"SURVEY",
reference:{"RESPONDENT":[],"SURVEY":[{"submit":"sample respondent","show":"sample respondent","$ref":"/api/v1/schema/9","referenceType":"respondent"},{"submit":"Sample Form 2","show":"Sample Form 2","$ref":"/api/v1/schema/10","referenceType":"respondent"},{"submit":"Sample Form 3","show":"Sample Form 3","$ref":"/api/v1/schema/11","referenceType":"respondent"}],"PRODUCT":[{"submit":"Product","show":"Product","$ref":"/api/v1/schema/8","referenceType":"product"}],"ADDRESS":[{"submit":"Address","show":"Address","$ref":"/api/v1/schema/1","referenceType":"address"}]}
});
fb.on('save', function(payload){
console.log(payload);
})
});
</script>
</body>
</html>