-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhaschanged.html
101 lines (82 loc) · 3.08 KB
/
haschanged.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
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/sunny/jquery-ui.css">
<link rel="stylesheet" href="css/mystyles.css">
<style>
.changed {
border: 1px solid #F00 !important;
background-color: #FAA;
}
select { width: 100px; }
</style>
<script src="js/libs/modernizr-2.0.6.min.js"></script>
</head>
<body>
<div id="container">
<header>
<h2>.hasChanged / :changed demo</h2>
</header>
<div id="main" role="main">
<form>
<fieldset>
<legend>Fields for hasChanged</legend>
<label for="text">Text Field</label>
<input type="text" id="text" name="text" value="" placeholder="Enter Text">
<label for="search">Search Field</label>
<input type="search" id="search" name="search" value="" placeholder="Enter Text">
<label for="email">Email Field</label>
<input type="email" id="email" name="email" value="" placeholder="Enter Email">
<label for="select-single">Single Select Field</label>
<select id="select-single" name="select-single">
<option value=""></option>
<option value="one">One</option>
<option value="two">Two</option>
<option value="three">Three</option>
<option value="four">Four</option>
</select>
<label for="select-multiple">Select Field</label>
<select id="select-multiple" name="select-multiple" multiple size="4">
<option value="one">One</option>
<option value="two">Two</option>
<option value="three">Three</option>
<option value="four">Four</option>
</select>
</fieldset>
</form>
</div>
<footer>
</footer>
</div> <!--! end of #container -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script src="js/autowire.js"></script>
<script src="js/jquery.changed.js"></script>
<script>
(function($) {
$(function() {
$('form').submit(function(event) { event.preventDefault(); });
$(':input').bind('change keyup click', function() {
if ($(this).hasChanged()) $(this).addClass('changed');
else $(this).removeClass('changed');
});
});
})(jQuery);
</script>
<!-- end scripts-->
<!--[if lt IE 7 ]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
<script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
<![endif]-->
</body>
</html>