Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - 判断射流研究…文本框数值是在1-1之间的正整数,用正则表达式控制输入,用功能验证
判断射流研究…文本框数值是在1-1之间的正整数,用正则表达式控制输入,用功能验证
& ltinput type = " text " name = " num " value = " " onblur = " test _ this();"& gt

JS脚本函数test _ this()

{

var reg = /^\d+$/;

if(value . constructor = = = String)

{

var re = value . match(reg);

返回true}

else

{

返回false}

if(document . formname . num . value & lt;1 | | document . formname . num . value & gt;1)

{

document . formname . num . focus();

返回false

}

}