如何只允许输入标签麻木 [英] How to make input tag numbes only allowed
本文介绍了如何只允许输入标签麻木的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< input type =textrunat =serverid =Empid占位符=员工ID>
在运行模式下如下
员工ID(仅允许数字)
能帮我吗?
我尝试过的事情:
如何让输入标签麻木只允许
解决方案
这个我用过的代码很久就在我的笔记里,不知道我从哪里来提供参考和信用:)。试试这个。
(document).ready( function (){
( # Empid)。keydown( function (e){
// < span class =code-comment>检查退格,删除,制表,转义,输入,不限制
如果(
<input type = "text" runat="server" id="Empid" Placeholder = "Employee id">
In run mode as follows
Employee id ( numbers only allowed)
for that how can i do please help me.
What I have tried:
how to make input tag numbes only allowed
解决方案
this the code i had used long back was in my notes, not sure where i had got from to provide the reference and credit :). Try this.
(document).ready(function() {
("#Empid").keydown(function (e) { // Check for backspace, delete, tab, escape, enter, do not restrict that if (
这篇关于如何只允许输入标签麻木的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文