form.html 3.83 KB
Newer Older
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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8">
		<link rel="shortcut icon" type="image/ico" href="http://www.sprymedia.co.uk/media/images/favicon.ico">
		
		<title>KeyTables example</title>
		<style type="text/css" title="currentStyle">
			@import "../../media/css/demo_page.css";
			@import "../../media/css/demo_table.css";
		</style>
		<script type="text/javascript" charset="utf-8" src="../../media/js/jquery.js"></script>
		<script type="text/javascript" charset="utf-8" src="js/KeyTable.js"></script>
		<script type="text/javascript" charset="utf-8">
			$(document).ready( function () {
				var keys = new KeyTable( {
					"form": true
				} );
			} );
		</script>
	</head>
	<body id="dt_example">
		<div id="container">
			<div class="full_width big">
				KeyTable form integration example
			</div>
			
			<h1>Preamble</h1>
			<p>One of possible use of KeyTable is to use a table as a form element (for example a calendar date selector). For this you want to be table to tab into and out of the table, as you would do with any other form element on the page.</p>
			<p>The example shown below as a small table as it's third input element, and you can tab between input fields. When the 'focus' reaches the end of the table, hitting tab will take you into the next field.</p>
			
			<h1>Live example</h1>
			
			<!-- bad use of a table! quick example of form though -->
			<table cellspacing="10" cellpadding="0" border="0" width="100%">
				<tr>
					<td>Input 1:</td>
					<td><input type="text" id="input1"></td>
				</tr>
				<tr>
					<td>Input 2:</td>
					<td><input type="text" id="input2"></td>
				</tr>
				<tr>
					<td>Input 3:</td>
					<td>
<table cellpadding="0" cellspacing="0" border="0" class="display KeyTable" id="example">
	<thead>
		<tr>
			<th>Rendering engine</th>
			<th>Browser</th>
			<th>Platform(s)</th>
			<th>Engine version</th>
			<th>CSS grade</th>
		</tr>
	</thead>
	<tbody>
		<tr class="gradeX">
			<td>Trident</td>
			<td>Internet Explorer 4.0</td>
			<td>Win 95+</td>
			<td class="center">4</td>
			<td class="center">X</td>
		</tr>
		<tr class="gradeC">
			<td>Trident</td>
			<td>Internet Explorer 5.0</td>
			<td>Win 95+</td>
			<td class="center">5</td>
			<td class="center">C</td>
		</tr>
		<tr class="gradeA">
			<td>Trident</td>
			<td>Internet Explorer 5.5</td>
			<td>Win 95+</td>
			<td class="center">5.5</td>
			<td class="center">A</td>
		</tr>
		<tr class="gradeA">
			<td>Trident</td>
			<td>Internet Explorer 6</td>
			<td>Win 98+</td>
			<td class="center">6</td>
			<td class="center">A</td>
		</tr>
		<tr class="gradeA">
			<td>Trident</td>
			<td>Internet Explorer 7</td>
			<td>Win XP SP2+</td>
			<td class="center">7</td>
			<td class="center">A</td>
		</tr>
	</tbody>
</table>
					</td>
				</tr>
				<tr>
					<td>Input 4:</td>
					<td><input type="text" id="input4"></td>
				</tr>
				<tr>
					<td>Input 5:</td>
					<td><input type="text" id="input5"></td>
				</tr>
			</table>
			<div class="spacer"></div>
			
			
			<h1>Initialisation code</h1>
			<pre>$(document).ready( function () {
	var keys = new KeyTable( {
		"form": true
	} );
} );</pre>
			
			
			<h1>Other examples</h1>
			<ul>
				<li><a href="index.html">Basic usage</a></li>
				<li><a href="editing.html">Editing a table</a></li>
				<li><a href="form.html">Integration with an HTML form</a></li>
				<li><a href="datatable.html">Integration with DataTables</a></li>
				<li><a href="datatable_scrolling.html">Using KeyTable with scrolling in DataTables</a></li>
			</ul>
			
			<div id="footer" style="text-align:center;">
				<span style="font-size:10px;">
					KeyTable &copy; Allan Jardine 2009.<br>
					Information in the table &copy; <a href="http://www.u4eatech.com">U4EA Technologies</a> 2007-2009.</span>
			</div>
		</div>
	</body>
</html>