forked from cs278/jquery.tokeninput
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.html
68 lines (56 loc) · 2.47 KB
/
sample.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
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="src/jquery.tokeninput.js"></script>
<link rel="stylesheet" href="styles/token-input.css" type="text/css" />
<link rel="stylesheet" href="styles/token-input-facebook.css" type="text/css" />
<script type="text/javascript">
var url = 'data/static.json';
$(document).ready(function() {
$("#tokenize").tokenInput(url);
$("#tokenize-suggested").tokenInput(url, {
hintText: "Type in the names of your favorite TV shows",
noResultsText: "No results",
searchingText: "Searching...",
requiresMatch: false,
suggestedTags: [{id: 'tag1', name: 'tag1', size: 1}, {id: 'tag2', name: 'tag2', size: 2}],
focusHint: false
});
$("#tokenize-facebook").tokenInput(url, {
classes: {
tokenList: "token-input-list-facebook",
token: "token-input-token-facebook",
tokenDelete: "token-input-delete-token-facebook",
selectedToken: "token-input-selected-token-facebook",
highlightedToken: "token-input-highlighted-token-facebook",
dropdown: "token-input-dropdown-facebook",
dropdownItem: "token-input-dropdown-item-facebook",
dropdownItem2: "token-input-dropdown-item2-facebook",
selectedDropdownItem: "token-input-selected-dropdown-item-facebook",
inputToken: "token-input-input-token-facebook"
}
});
});
</script>
</head>
<body>
<h1>Jquery Tokenizing Autocomplete Input</h1>
<h2>Notice: improved sample available</h2>
<p>If you have PHP running, please visit instead <a href="sample.php">sample.php</a> for a richer sample.</p>
<p>The autocomplete data loaded in this non-HTML version is not actually sensitive to the query entered, so autocomplete will suggest the same thing no matter what you start typing.</p>
<form method="post">
<fieldset>
<legend>Vanilla example</legend>
<input type="text" id="tokenize" name="tokenize" />
</fieldset>
<fieldset>
<legend>Suggested tags</legend>
<input type="text" id="tokenize-suggested" name="tokenize-suggested" />
</fieldset>
<fieldset>
<legend>Facebook style</legend>
<input type="text" id="tokenize-facebook" name="tokenize-facebook" />
</fieldset>
</form>
</body>
</html>