Jquery掩码插件

在最近项目中需要用到一些输入过滤,很自然的就想到需要使用掩码来进行操作,因为这样会尽量使程序变得简单。查找了Jquery,发现一款插件能够解决这个问题,插件地址为:http://space.cz2000.cn/batch.viewlink.php?itemid=3940


在此摘录一段原文,有助于理解其用法:
First, include the masked input javascript file.

Next, call the mask function for those items you wish to have masked.

jQuery(function($){
$("#date").mask("99/99/9999");
$("#phone").mask("(999) 999-9999");
$("#tin").mask("99-9999999");
$("#ssn").mask("999-99-9999");
});
Optionally, if you are not satisfied with the underscore ('_') character as a placeholder, you may pass an 
optional argument to the maskedinput method.

jQuery(function($){
$("#product").mask("99/99/9999",{placeholder:" "});
});
Optionally, if you would like to execute a function once the mask has been completed, you can specify that 
function as an optional argument to the maskedinput method.

jQuery(function($){
$("#product").mask("99/99/9999",{completed:function(){alert("You typed the following: "+this.val());}});
});
You can now supply your own placeholder character definitions.

jQuery(function($){
$.mask.addPlaceholder('~',"[+-]");
$("#eyescript").mask("~9.99 ~9.99 999");
});

插件的JS文件请到上述地址去下载。
jquery.maskedinput.js掩码输入框(自动格式化输入文本) 这个实例主要演示使用jquery.maskedinput.js插件实现输入框自动格式化数据,掩码文本输入框,可以理解为,当用户输入的文本框是时间格式,则本插件会将用户的输入自动变为时间格式,并为其自动添加时间分隔条款,言外之意,如果是规定位数的小数,则也可在用户输入时自动小数点,立即让你的前台网页聪明起来,当然,jquery.maskedinput.js插件的用法还不只这些,那么通过本例子,你将了解到更多数据格式的定义,扩展你的前端应用。 运行环境:HTML/PHP/ASP/ 立即下载

相关推荐

edittext-mask,EditText的自定义掩码。android的输入电话号码、ssn等解决方案.zip

此项目源于Toshikurauchi/Maskededitext,但它已针对Gradle构建系统进行了调整,并具有其他功能:

jQuery/javascript实现IP/Mask(IP/掩码)自动联想功能

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34033624的博客 371

VanillaMask:在表单字段上制作掩码的插件

香草面膜 在表单字段上制作掩码的插件 用法 没有 jQuery new VanillaMask ( document . querySelector ( "#cellphone" ) , { masks : [ "(99) 9999-9999" , "(99) 99999-9999" ] , onComplete : function ( ) { console . log ( 'mask complete' ) ; } } ) ; 使用 jQuery $ ( "#cellphone" ) . VanillaMask ( { masks : [ '(99) 9999-9999' , '(99) 99999-9999' ] } ) . on ( 'complete.VanillaMask' , function ( ) { console . log ( 'mask

【jQuery插件】Masked Input Plugin实现文本框掩码效果

经常使用的最熟悉的子网掩码就是提供一个固定的格式,你只能按对应的格式输入相应的IP数值,使用jQuery插件Masked Input Plugin可以实现一个类似掩码的功能,可以应用于具有特殊格式的文本表单框中,如日期(2009-05-17)、电话号码(0571-12345678)等,使用Masked Input Plugin不仅可以指定格式,还可以进行表单输入控制,如数字,字母等,效果图如下:在线查看Masked Input Plugin演示http://www.biuuu.com/demo/mask/i

meikidd的专栏 2594

2025 居民消费结构数据集(21列,15000条记录)XLSX

详情介绍:该数据集为 2025 年 12 个月、1250 户家庭的平衡面板消费数据,15000 行 ×21 列零缺失,覆盖 31 省、城乡均衡,含八大类消费支出和恩格尔系数(均值 0.293,属富裕区间),家庭月收入均值 8473 元、月支出 6487 元,附完整字段说明 sheet,数据干净规整,非常适合做消费结构分析、面板回归、城乡 / 区域差异对比和收入等级分类预测,但为合成数据、仅 1 年时间跨度,不适合做真实政策研究或长期趋势分析。

Android Studio打包全攻略---从入门到精通

初出茅庐 手动打包怎么手动打包项目写完了,现在需要把应用上传到市场,问题出现—怎么把代码变成.apk(Android的可安装文件)。 1. 创建签名文件 2. 填写好签名参数 3. 生成APK 注意:签名的密码和密匙的密码注意保管,不要忘了,签名文件别泄漏了,也别搞丢了为什么要打包我最开始就有这个疑问,我们的代码不是点了下运行按钮就直接安装到手机上了吗,我们在在项目Project

我早就想,要这样载着你,翻山越岭 2万+

jQuery的maskedinput插件 设置input掩码

一.下载插件  http://digitalbush.com/projects/masked-input-plugin/二。属性a: 表示只能输入大小写字母9:表示只能输入0-9之间的数字*:a和9的结合placeholder:占位符三。方法mask(param1,pararm2):param1:限制输入格式,param2:制定占位符umask():删除输入格式的限制四.扩展 方法 可以根据自己的...

weixin_34362991的博客 350

SAP FI实战入门:从借贷法则到F-02记账,新手必懂的会计凭证操作

本文详细介绍了SAP FI模块中借贷记账法的核心逻辑及F-02凭证录入的全流程操作。通过实例解析借贷方向规则、科目编码设置及金额镜像原则,帮助新手快速掌握会计凭证操作技巧。同时提供了FS10N余额查询和常见错误排查方法,助力用户高效完成SAP财务记账任务。

weixin_29306571的博客 263

jQuery插件Masked Input Plugin实现文本框掩码效果

插件地址:   http://plugins.jquery.com/project/maskedinput   依赖:   <script src="jquery.js" type="text/javascript"></script> <script src="jquery.maskedinput.js" type="text/javascrip.

iteye_12887的博客 241

AnyGrasp实战指南:从环境配置到抓取检测与跟踪

本文详细介绍了AnyGrasp从环境配置到抓取检测与跟踪的实战指南。涵盖硬件要求、关键依赖安装避坑、抓取检测与跟踪的实战技巧,以及常见问题解决方案和性能优化建议,帮助开发者快速掌握这一高精度物体抓取检测与跟踪技术。

weixin_33712987的博客 274

STM32H743IIT6+USB3300高速HID通讯实战:从CUBEMX配置到调试避坑全记录

本文详细记录了基于STM32H743IIT6微控制器与USB3300 PHY芯片实现高速USB HID通信的完整实战过程。内容涵盖从硬件选型、STM32CubeMX工程配置(重点规避引脚映射等常见陷阱)、自定义报告描述符编写,到驱动层数据收发实现与高级调试技巧的全链路解析,旨在帮助开发者快速构建稳定、高效的嵌入式高速数据通道。

vscode5coder的博客 364

jQuery.maskedinput 表单输入掩码插件使用详解

输入掩码(Input Mask)是一种用于规范用户输入格式的技术,它通过在输入框中预定义格式模板,引导用户按照特定模式输入数据。这种技术在表单处理中非常实用,能够有效减少用户输入错误,提升数据质量。 ## jQuery.maskedinput 插件简介 jQuery.maskedinput 是一个轻量级的jQuery插件,专门用于实现表单输入掩码功能。它通过简单的配置就能为各种输入框添加格式约...

gitblog_00353的博客 461

RAG在医药行业为什么80%都翻车了?

这篇文章不是要劝你别做RAG,而是把坑说清楚。医药行业有它的特殊性——监管压力、专业术语密度、多语言混排、文档结构复杂——这些因素叠加在一起,让标准RAG教程里的那套方法论几乎直接失效

qq_31808385的博客 635

jQuery inputMask字母数字下划线掩码插件!!含API帮助、源码、示例

1、插件参数说明 jQuery inputMask掩码插件,是一个很简单的掩码控制插件(简单的不敢拿出来,因为有人需要就发出来),实现对字母、数字、下划线三种类型的输入控制,你可以任意组合。 这个插件的应用场合,主要是: 1、用户名的输入; 2、配合autoComplete做未输入控制(你可能根据拼音或者五笔来查找数据); 3、一些常规的数据输入。 如果你结合我写的formVali...

weixin_33843947的博客 340

【ESP32开发】——开发环境搭建(VSCode+PlatformIO)

本章内容主要介绍ESP32的开发环境搭建(基于VSCode+PlatformIO)的流程与相应的注意事项,避免开发ESP32止于环境搭建!在项目的维护过程中,可以更好地管理和更新代码、调试问题,并且能够快速适应和采用新的功能、库或硬件平台。:VSCode 的代码提示和自动补全功能,以及 PlatformIO 的管理工具,都能帮助你编写规范、格式良好且易于阅读的代码。:Arduino 框架是一种简单、易用的嵌入式开发框架,适用于快速原型开发和小型项目。需要选择对应自己开发的开发板型号。

m0_61934621的博客 8417

Chrome下载B站视频字幕的插件

本文主要介绍了Chrome下载B站视频字幕的插件,希望能对使用Chrome的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案

weixin_43178406的博客 3万+

jQuery DateTimeMask日期掩码插件即将发布,做为新年大礼献给园子里的朋友!

这个插件是我在园子里的第二个插件,希望大家支持我!谢谢大家! jQuery DateTimeMask日期掩码插件,能比较完美的控制日期的输入,在ie6.0和firefox3.0下调试通过。本插件采用配置信息的思想,主要有以下配置参数 safemodel: true,                 //安全模式下,不能粘贴,不能拖拉 masktype: "3",               ...

weixin_34261739的博客 133

YOLO11涨点优化:loss优化 | 一种新的基于Wasserstein距离的小目标检测评估方法,助力小目标涨点

提出了一种新的基于Wasserstein距离的小目标检测评估方法,通过它们对应的高斯分布计算它们之间的相似性

①答疑群聊服务;②YOLO大模型知识问答系统;③计算机视觉论文生成智能体; 1018

掩码操作(& | >>> <<)

2进制 int n = 45; System.out.println(Integer.toBinaryString(n)); 计算机的内部(Java)只有2进制数据, 在显示的时候编程语言提供API将2进制转换为10进制显示出来. 计算机只能处理2进制数据, 利用编程语言提供的算法支持了10进制 Java中用于支持2进制两个算法(方法): Integer.toS

荒的博客 5100

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

jQuery对字符串内身份证号和手机号码进行脱敏

什么是脱敏 数据脱敏是指对某些敏感信息通过脱敏规则进行数据的变形,实现敏感隐私数据的可靠保护。在涉及客户安全数据或者一些商业性敏感数据的情况下,在不违反系统规则条件下,对真实数据进行改造并提供测试使用,如身份证号、手机号、卡号、客户号等个人信息都需要进行数据脱敏。 实现方法 //数字从第四位至倒数第四位脱敏 function formatNumber(value) { var val = '' if (value.length > 0) {

忧天的杞人 2371

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

遮罩输入插件jquery.maskedinput.js学习

第一、初识 遮罩输入插件是jqueryoverviewthis的一个遮罩的输入jQuery插件库。它允许用户更容易进入固定宽度输入你所希望的以一定的格式输入数据(日期,电话号码,等)。它已在Internet Explorer,Firefox,Safari,Opera和Chrome等浏览器上测试过。遮罩的定义是由一个格式由遮罩的文字和掩码定义。任何字符不在定义列表下面的被认为是遮罩文字。遮罩文字会...

陈袁的博客 2821

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

jquery 正则表达式金额_jquery正则表达式电话时间等数字格式验证

$(function() {$.mask.definitions['~'] = "[+-]";$("#date").mask("99/99/9999",{completed:function(){alert("completed!");}});$("#phone").mask("(999) 999-9999");$("#phoneExt").mask("(999) 999-9999? x99999...

weixin_39799565的博客 148

对电话号码验证、掩码、加密适用匿名类处理

如何对电话号码进行有效判断,并对其添加掩码,加密等相关措施,本实例是我们在实际工作中遇到的情况进行了归类总结,具有很强的适用性,分享出来给大家!! package main; /** * 电话号码处理工具 * * @author Ligang.Wang[wlgchun@163.com] * @date 2017年8月22日 下午3:10:50 */ public cl...

Feify博客 2702

手机号中间四位掩码

<!DOCTYPE html> <html> <head> <title>手机号中间四位掩码</title> </head> <body> <script type="text/javascript"> var phone = '13521780133' var conract =...

sally18的博客 2569
上一篇: Jquery掩码插件
下一篇: JSON的基本格式
pythoner
博客等级 码龄18年 15粉丝 89原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值