Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于前导零和从右向左的文档的jQuery掩码_Jquery_Mask - Fatal编程技术网

用于前导零和从右向左的文档的jQuery掩码

用于前导零和从右向左的文档的jQuery掩码,jquery,mask,Jquery,Mask,我们的人民 我在应用程序中的几个字段中使用jquery.maskedit插件,我想不出如何编写这样的掩码: <div class="input-wrapper"> <span class="input-pre"></span> <input type="text"> </div> 文件:000000-0 我需要这个字段总是用零和从右到左的方向来填充 是否有jQuery插件或有人知道如何使用jQuery.maskedit

我们的人民

我在应用程序中的几个字段中使用jquery.maskedit插件,我想不出如何编写这样的掩码:

<div class="input-wrapper">
    <span class="input-pre"></span>
    <input type="text">
</div>
文件:000000-0

我需要这个字段总是用零和从右到左的方向来填充


是否有jQuery插件或有人知道如何使用jQuery.maskedit设置此掩码?

免责声明:存在漏洞。但这是一种方法

$.fn.specialMask=函数(){
this.on('click focus',函数(){
var self=这个;
setTimeout(function(){self.value=self.value;},15);//将光标移到末尾
}) 
.on(按键),功能(e){
变量
号码,
$this=$(this),
cur=$this.val().match(/Document:([0-9]*\-[0-9])/);//获取值
如果(cur[1][0]!=='0'){return;}//输入已满

如果(e.keyCode>=48&&e.keyCode=96&&e.keyCode免责声明:存在漏洞。但这是一种方法

$.fn.specialMask=函数(){
this.on('click focus',函数(){
var self=这个;
setTimeout(function(){self.value=self.value;},15);//将光标移到末尾
}) 
.on(按键),功能(e){
变量
号码,
$this=$(this),
cur=$this.val().match(/Document:([0-9]*\-[0-9])/);//获取值
如果(cur[1][0]!=='0'){return;}//输入已满
如果(e.keyCode>=48&&e.keyCode=96&&e.keyCode
<div class="input-wrapper">
    <span class="input-pre"></span>
    <input type="text">
</div>