<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery AlphaNumeric</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.alphanumeric.pack.js"></script>
<style>
body{margin:0px;padding:0px;font-family:Arial,Helvetica,sans-serif;font-size:12px}h1{font-weight:normal;font-size:24px;margin:10px 0px;color:#003366}.container{background:#eee;margin:20px;padding:10px}a{color:#0099FF;text-decoration:none}.sample{background:#ccc;padding:10px;border:1px solid #fff;margin-bottom:10px}h2{margin:10px 0px;font-size:18px;color:#0033FF;font-weight:normal}.code{background:#fff;padding:10px;border-top:5px solid #aaa;margin:10px 0px;display:none}.tb{border:0px;padding:5px;font-size:12px;font-family:Verdana,Arial,Helvetica,sans-serif}.list li{margin-bottom:10px}
</style>
</head>
<body>
<div class="container">
<h1> </h1>
<div class="sample">
<h2>Examples</h2>
<ol class="list">
<li>
<b>Allow only alphanumeric characters</b>
<input type="text" class="sample1 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample1').alphanumeric();</div>
</li>
<li>
<b>Allow only alphanumeric characters, and some exceptions like dot(.), comma (,) and space</b>
<input type="text" class="sample2 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample2').alphanumeric({allow:"., "});</div>
</li>
<li>
<b>Allow only lowercase alpha characters</b>
<input type="text" class="sample3 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample3').alpha({nocaps:true});</div>
</li>
<li>
<b>Allow only numeric characters</b>
<input type="text" class="sample4 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample4').numeric();</div>
</li>
<li>
<b>Allow only numeric characters, and some exceptions like dot (.)</b>
<input type="text" class="sample5 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample5').numeric({allow:"."});</div>
</li>
<li>
<b>Make a custom rule and define only certain characters to prevent, like dot (.), one (1), and a (a)</b>
<input type="text" class="sample6 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample6').alphanumeric({ichars:'.1a'});</div>
</li>
</ol>
</div>
<h2>API Functions</h2>
<ol>
<li><b>alphanumeric</b> - allow both alphabet and numeric characters</li>
<li><b>alpha</b> - allow only alphabet characters</li>
<li><b>numeric</b> - allow only numeric characters</li>
</ol>
<h2>API Properties</h2>
<ol>
<li><b>allow</b> - add excempted characters to the rule of prevention</li>
<li><b>ichars</b> - define a custome set of characters to prevent</li>
<li><b>allcaps</b> - allow only capital letters to be entered</li>
<li><b>nocaps</b> - allow only lowercase characters to be entered</li>
</ol>
<div style="clear:both"></div>
</div>
<script type="text/javascript">
$('.vcode').click(function(){$(this).next().toggle('slow'); return false;});
$('.sample1').alphanumeric();
$('.sample2').alphanumeric({allow:"., "});
$('.sample3').alpha({nocaps:true});
$('.sample4').numeric();
$('.sample5').numeric({allow:"."});
$('.sample6').alphanumeric({ichars:'.1a'});
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
jquery输入字符过滤
共4个文件
js:3个
html:1个
5星 · 超过95%的资源 需积分: 10 164 下载量 28 浏览量
2008-08-02
23:18:38
上传
评论
收藏 14KB RAR 举报
温馨提示
jquery输入字符过滤过滤插件,代码实现很简单
资源推荐
资源详情
资源评论
收起资源包目录
字符过滤.rar (4个子文件)
字符过滤
jquery.alphanumeric.js 1KB
jquery.alphanumeric.pack.js 1KB
jquery.js 22KB
index.html 4KB
共 4 条
- 1
资源评论
- sun28long2013-11-08代码不错, 但是能不能建个列表之类的?
- liyunlong45415482014-03-03学习了很不错!!!
- huaifeng2013-09-17看了下资源不错,虽然我没用上。
- 梵瑾箬2013-02-18参看之后终于解决了我的问题,感谢有你
大猪窝
- 粉丝: 17
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功