-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
64 lines (62 loc) · 1.46 KB
/
example.html
File metadata and controls
64 lines (62 loc) · 1.46 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery Form Watcher | Basic Example</title>
<style>
form {
border: 1px solid #CCC;
padding: 50px;
}
form legend {
font-weight: bold;
font-size: 2em;
margin-bottom: 50px;
}
form input[type="text"],
form textarea {
display: block;
width: 100%;
margin-bottom: 20px;
border: 1px solid #ccc;
padding: 5px;
}
form input[type="text"]:focus,
form textarea:focus {
border-color: blue;
}
</style>
</head>
<body>
<form action="example.html" method="post">
<legend>Formwatcher Example</legend>
<label>Text 1</label>
<input type="text" name="test1_1" />
<label>Textarea 1</label>
<textarea name="test1_2" rows="15"></textarea>
<button type="submit">Submit Form</button>
</form>
<hr />
<form action="example.html" method="post">
<legend>Formwatcher Example 2</legend>
<label>Text 1</label>
<input type="text" name="test2_1" />
<label>Text 1</label>
<input type="text" name="test2_2" />
<button type="submit">Submit Form</button>
</form>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="formwatcher.js"></script>
<script>
$(document).ready(function(){
$('form').formWatcher({
message: 'YOu sure',
onChange: function(form, diff)
{
console.log(diff);
}
});
});
</script>
</body>
</html>