-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.html
95 lines (90 loc) · 3.01 KB
/
examples.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
91
92
93
94
95
<!doctype html>
<html class="no-js" lang="de">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>jQuery Form Plugin</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<main>
<form name="form-name-1" method="post" action="#">
<fieldset>
<legend>Formular One</legend>
<label>Input:
<input name="input1" type="text" value="Text input default value">
</label>
<label>Input:
<input name="input2" type="text" value="Text input default value">
</label>
<label>Input:
<input name="input3" type="text" value="Text input default value">
</label>
<label>Select:
<select name="select1">
<option value="Value0">Title0</option>
</select>
</label>
<label>Textarea:
<textarea name="textarea1">Textarea default value.</textarea>
</label>
<label>Checkbox:
<input name="checkobox1" type="checkbox" checked> Checkbox 1
</label>
</fieldset>
</form>
<form name="form-name-2" method="post" action="#">
<fieldset>
<legend>Formular Two</legend>
<label>Input:
<input name="input1" type="text" value="value">
</label>
<label>Select:
<select name="select1">
<option value="Value One">Option One</option>
<option value="Value Two" selected="selected">Option Two</option>
<option value="Value Three">Option Three</option>
</select>
</label>
</fieldset>
</form>
</main>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="jquery.form.js"></script>
<script>
$(function () {
var form1 = $('[name="form-name-1"]').form(),
form2 = $('[name="form-name-2"]').form();
form1
.clear(['input2'])
.fill({
undefined1: 'undefined element',
input1: 'input1',
select1: [
{
title: 'Title0',
value: 'Value0'
},
{
title: 'Title1',
value: 'Value1',
selected: true
}
],
textarea1: 'textarea1'
})
.read(function (data) {
console.log(data);
});
form2
.clear()
.fill({
input1: 'input1',
select1: 'Value One'
})
.disable();
});
</script>
</body>
</html>