forked from shaneriley/jquery_remember_state
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
134 lines (133 loc) · 5.42 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<title>LocalStorage and Unload State Save</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="stylesheets/form.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="jquery.remember-state.js"></script>
<script>
$(function() {
$("form").rememberState({ objName: "personal_info" }).submit(function() {
localStorage.setObject("personal_info", $(this).serializeArray());
return false;
}).delegate("p.remember_state a", "click", function() {
$("input[type=range]").change();
});
$("input[type=range]").change(function() {
$(this).closest("dd").find("span").text($(this).val());
}).change();
});
</script>
</head>
<body>
<form action="" method="post">
<fieldset>
<dl>
<dt><label for="first_name">First Name</label></dt>
<dd><input type="text" name="first_name" id="first_name" /></dd>
<dt><label for="last_name">Last Name</label></dt>
<dd><input type="text" name="last_name" id="last_name" /></dd>
<dt><label for="gender_female">Gender</label></dt>
<dd>
<ul>
<li>
<label>
<input type="radio" name="gender" id="gender_female" value="Female" />
Female
</label>
</li>
<li>
<label>
<input type="radio" name="gender" id="gender_male" value="Male" />
Male
</label>
</li>
</ul>
</dd>
<dt><label for="marital_status">Marital Status</label></dt>
<dd>
<select name="marital_status" id="marital_status">
<option selected value="Single">Single</option>
<option value="Married">Married</option>
<option value="Divorced">Divorced</option>
<option value="Separated">Separated</option>
</select>
</dd>
<dt><label for="bio">Bio</label></dt>
<dd><textarea name="bio" id="bio" rows="8" cols="40"></textarea></dd>
<dt><label for="interests_video_games">Interests</label></dt>
<dd>
<ul>
<li>
<label>
<input type="checkbox" id="interests_video_games" name="video_games" value="Video games" />
Video games
</label>
</li>
<li>
<label>
<input type="checkbox" id="interests_beach_walks" name="beach_walks" value="Long walks on the beach" />
Long walks on the beach
</label>
</li>
<li>
<label>
<input type="checkbox" id="interests_dendrophilia" name="dendrophilia" value="Dendrophilia" />
Dendrophilia
</label>
</li>
</ul>
</dd>
<dt><label for="relationship_type">Looking for</label></dt>
<dd>
<select id="relationship_type" name="relationship_type" multiple>
<optgroup label="Man">
<option value="m_w">seeking women</option>
<option value="m_m">seeking men</option>
</optgroup>
<optgroup label="Woman">
<option value="w_m">seeking men</option>
<option value="w_w">seeking women</option>
</optgroup>
</select>
</dd>
</dl>
<h1>New Input Types</h1>
<dl>
<dt><label for="email">input[type="email"]</label></dt>
<dd><input type="email" name="email" id="email" /></dd>
<dt><label for="search">input[type="search"]</label></dt>
<dd><input type="search" name="search" id="search" /></dd>
<dt><label for="tel">input[type="tel"]</label></dt>
<dd><input type="tel" name="tel" id="tel" /></dd>
<dt><label for="color">input[type="color"]</label></dt>
<dd><input type="color" name="color" id="color" /></dd>
<dt><label for="number">input[type="number"]</label></dt>
<dd><input type="number" name="number" id="number" min="0" /></dd>
<dt><label for="week">input[type="week"]</label></dt>
<dd><input type="week" name="week" id="week" min="1901-W01" /></dd>
<dt><label for="time">input[type="time"]</label></dt>
<dd><input type="time" name="time" id="time" min="06:00:00.00" /></dd>
<dt><label for="month">input[type="month"]</label></dt>
<dd><input type="month" name="month" id="month" min="1901-01" /></dd>
<dt><label for="date">input[type="date"]</label></dt>
<dd><input type="date" name="date" id="date" min="1901-01-01" /></dd>
<dt><label for="datetime">input[type="datetime"]</label></dt>
<dd><input type="datetime" name="datetime" id="datetime" min="1901-01-01T06:00:00" /></dd>
<dt><label for="datetime-local">input[type="datetime-local"]</label></dt>
<dd><input type="datetime-local" name="datetime-local" id="datetime-local" min="1901-01-01T06:00:00-06:00" /></dd>
<dt><label for="age_range">input[type="range"]</label></dt>
<dd>
<input type="range" name="age_range" id="age_range" min="18" max="100" step="1" value="18" />
<span></span>
</dd>
</dl>
</fieldset>
<fieldset class="actions">
<input type="submit" value="Save" />
<input type="reset" value="Delete" />
</fieldset>
</form>
</body>
</html>