forked from jaz303/jquery-grab-bag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput-hint.html
73 lines (60 loc) · 2.69 KB
/
input-hint.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>jQuery Grab Bag - Input Hint Plugin</title>
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://onehackoranother.com/feed/" />
<link rel="alternate" type="text/xml" title="RSS .92" href="http://onehackoranother.com/feed/rss/" />
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="http://onehackoranother.com/feed/atom/" />
<script type='text/javascript' src='javascripts/jquery-1.2.6.min.js'></script>
<script type='text/javascript' src='javascripts/jquery.input-hint.js'></script>
<link rel="stylesheet" href="stylesheets/main.css" type="text/css" />
<style type='text/css'>
.hint { color: #808080; }
#test-form { border: 1px solid #a0a0a0; padding: 0.5em; background-color: #f0f0f0; }
</style>
<script type='text/javascript'>
$(function() {
$('*[@hint]').inputHint();
});
</script>
</head>
<body>
<div id='container'>
<h1>
grab bag <span class='subtitle'>- assorted jQuery plugins</span>
</h1>
<div id='sidebar'>
<ul id='project-nav'>
<li><a href='index.html'>Plugin List</a></li>
</ul>
<ul id='ohoa-nav'>
<li><a href='http://onehackoranother.com/feed/' id='subscribe'>Subscribe for updates »</a></li>
<li><a href='http://onehackoranother.com/projects/'>Back to projects »</a></li>
<li><a href='http://onehackoranother.com/'>Back to onehackoranother.com »</a></li>
</ul>
</div>
<div id='main'>
<h2>Input Hint</h2>
<p>
Display hints to users within a text input and remove them automatically on focus/form
submission. This implementation relies on a non-standard attribute,
<code>hint</code>; if displaying a VALID XHTML badge is precious to you this
is going to mess up your day.
</p>
<div class='caption'>Example:</div>
<pre>HTML:
<input type='text' name='forename' hint='Forename' />
JS:
$('*[@hint]').inputHint();</pre>
<form method='post' id='test-form'>
<input type='text' hint='Forename' name='forename' /><br/>
<input type='text' hint='Surname' name='surname' />
<input type='submit' value='Submit' />
</form>
<h2>Direct Link</h2>
<p><a href='http://github.com/jaz303/jquery-grab-bag/tree/master/javascripts/jquery.input-hint.js'>jquery.input-hint.js</a></p>
</div>
</div>
</body>
</html>