您的位置:首页 > 其它

文本框限制字符长度+文本框限制只能填数字+文本框只读 不可编辑

2016-04-20 10:15 253 查看
//maxlength="11" 字符长度

//onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"  只能编辑数字

<input  type="text"  maxlength="11" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" />

//disabled="true"   文本框只读 不可编辑

<input typr="type" disabled="true" />

// 去除文本框边框

style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '

//自动获取光标

//文本框手动输入字符串  长度到时   光标自动跳入下一个文本框

$("#year").bind("input propertychange",function(){

                if($("#year").val().length==4){

                    $("#month").focus();

                }

            });

oninput=changeVale(this.value)//监听文本框内容

"<td><input type='text' style='width:90%' attr-name='discounts' id='discounts"+j+"' oninput=changeVale(this.value,'discounts"+j+"',"+j+") disabled='disabled'/></td>";//折扣

//文字从表格左侧开始   css  属性

text-indent:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: