admin管理员组文章数量:1401281
So below is my snippet, currently inputmask allow only this format "_." (e.g 5.55). Is there a way I could extend the format like I want this format "._____________.." (e.g 55.555555555555555555555... where after 55. the rest of the input digits must be unlimited). Any ideas, help, clues, suggestions, remendations please?
$(document).ready(function(){
$('.decimal').inputmask({ mask: "*[.**]", greedy: false, definitions: { '*': { validator: "[0-9]" } } });
});
<script src=".1.1/jquery.min.js"></script>
<script src=".inputmask/3.x/dist/jquery.inputmask.bundle.js"></script>
<input type="text" class="decimal form-control" />
So below is my snippet, currently inputmask allow only this format "_." (e.g 5.55). Is there a way I could extend the format like I want this format "._____________.." (e.g 55.555555555555555555555... where after 55. the rest of the input digits must be unlimited). Any ideas, help, clues, suggestions, remendations please?
$(document).ready(function(){
$('.decimal').inputmask({ mask: "*[.**]", greedy: false, definitions: { '*': { validator: "[0-9]" } } });
});
<script src="https://ajax.googleapis./ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://rawgit./RobinHerbots/jquery.inputmask/3.x/dist/jquery.inputmask.bundle.js"></script>
<input type="text" class="decimal form-control" />
Share
Improve this question
asked Dec 1, 2015 at 1:36
Juliver GalletoJuliver Galleto
9,05727 gold badges92 silver badges168 bronze badges
3 Answers
Reset to default 4$('.decimal').inputmask({ mask: "99.9{1,}"})
{1,}
= minimum 1 , infinite
for the preceding char , if you need it optional {0,}
Inputmask("*{n}").mask($(".text_only"));
Here n stands for n number
This doesn't exactly answer the question but in my case I wanted unlimited integers, so I used the expression:
9{0,}
本文标签: javascriptinputmask must allow unlimited digitsStack Overflow
版权声明:本文标题:javascript - inputmask must allow unlimited digits - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744296737a2599378.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论