-
Notifications
You must be signed in to change notification settings - Fork 6
/
form.html
67 lines (66 loc) · 1.42 KB
/
form.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
<!DOCTYPE html>
<html>
<head>
<title>form.js</title>
<script type="text/javascript" src="form.js"></script>
<script type="text/javascript">
obj = {
name: 'form.js',
description: 'Javascript library that creates HTML form inputs easily',
version: 0.1,
published: false,
categories: [{
id: 1,
name: 'Javascript'
},{
id: 2,
name: 'Forms'
}],
status: 'beta'
};
form = new Form(obj, {
name: 'object'
});
document.write(form.input('name'));
document.write(form.input('description', {
as: 'textarea'
}));
document.write(form.input('version'));
document.write(form.input('published'));
document.write(form.input('categories', {
collection: [{
id: 1,
name: 'Javascript'
},{
id: 2,
name: 'Forms'
},{
id: 3,
name: 'HTML5'
}]
}));
document.write(form.input('categories', {
as: 'select',
collection: [{
id: 1,
name: 'Javascript'
},{
id: 2,
name: 'Forms'
},{
id: 3,
name: 'HTML5'
}]
}));
document.write(form.input('status', {
collection: ['alpha', 'beta', 'release candidate'],
as: 'radio'
}));
document.write(form.input('status', {
collection: ['alpha', 'beta', 'release candidate']
}));
</script>
</head>
<body>
</body>
</html>