jquery.alphanum
Version:
Restrict what characters that may be entered into text fields. Supports alphanumeric, alphabetic or numeric. Easy to use. Fully customisable. Cross Browser compatible.
50 lines (34 loc) • 1.02 kB
HTML
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>The W3C Markup Validation Service</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="lib/jquery.js"></script>
<script type="text/javascript" src="jquery.alphanum.js"></script>
<script type="text/javascript">
</script>
<link rel="stylesheet" type="text/css" href="lib/browserReset.css"></link>
<style type="text/css">
</style>
</head>
<body>
<h1>alphanum()</h1>
<input id="firstName"></input>
<h1>numeric()</h1>
<input id="accountBalance"></input>
<h1>alphanum()</h1>
<textarea id="aboutMe"></textarea>
<a href="test/">QUnit Tests</a>
<script type="text/javascript">
//$.fn.alphanum.setNumericSeparators(".", ",");
$('#firstName') .alphanum({
allow: ''
});
$('#accountBalance').numeric({
maxPreDecimalPlaces : 10,
maxDecimalPlaces : 2
});
$('#aboutMe').alphanum();
</script>
</body>
</html>