-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
51 lines (45 loc) · 1.39 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
<!DOCTYPE html>
<html>
<head>
<!-- <script src="jquery.js"></script> -->
<!-- <script src="../tinyvalidation/tinyvalidation.js"></script> -->
<script src="./simpleform.js"></script>
<script>
function Student (name, password, enrolled) {
this.name = name;
this.password = password;
this.enrolled = enrolled;
this.id = Student.nextId++;
}
Student.nextId = 1;
var student = new Student("Alan Turing", "admin", true);
function setup () {
var options = {
html: {"data-validate-on-load": true}
};
simpleFormFor(student, options, function (f) {
f.string("name", {required: true, html: {"data-validate": "notEmpty"}});
f.checkbox("enrolled");
f.select("batch_number", ["Batch 0", "Batch 1", "Batch 2"]);
f.radio("radio_station", ["98.9FM", "104.3FM", "97.1FM"]);
f.password("password", {html: {"data-validate": "notEmpty"}});
f.submit();
f.done();
});
//$("#student-container form").tinyValidation({validateOnKeyUp: true});
}
</script>
<style>
input[type=text], input[type=password] {
border: 1px solid black;
}
.error {
border: 1px solid red;
}
</style>
</head>
<body onload="setup()">
<div id="student-container">
</div>
</body>
</html>