public
Description: JavaScript that spies on your forms and warns people if they try to leave a form with unsaved changes.
Homepage: http://indielabs.com/entries/the-informant/
Clone URL: git://github.com/ihearithurts/informant.git
informant / demo.html
100644 32 lines (24 sloc) 1.049 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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Informant Demo</title>
<style type="text/css" media="screen">
body { background: #eee; margin: 50px; font-family: Helvetica, Arial, sans-serif; }
form { background: #fff; padding: 30px 50px; width: 600px; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js" type="text/javascript"></script>
<script src="informant.min.js" type="text/javascript"></script>
</head>
 
<body>
 
<h1>Informant Demo</h1>
 
<form>
 
<p>If you <strong>leave the text field blank</strong> and click the link, nothing will happen.</p>
<p>If you <strong>enter text into the field</strong> and click the link, you'll be warned.</p>
<p><input type="text" name="my_text" /></p>
<p><a href="http://google.com">Leave the site!</a></p>
<p><input type="submit" value="Submit" /></p>
 
</form>
 
</body>
</html>