📄 check.js
字号:
function checkdtinput()
{
if ((event.keyCode >= 48 && event.keyCode <= 57 ) || event.keyCode==47)
event.returnValue = true;
else
event.returnValue = false;
}
function checkdate(varthis)
{
var ls=varthis.value;
var id = 0;
if(ls==null||ls=="")
{
return 0;
}
if(ls.length==10)
{
if((ls.split("/")[0]*1>1900) && (ls.split("/")[0]*1<2200))
{
if((ls.split("/")[1]*1>0) && (ls.split("/")[1]*1<13))
{
if((ls.split("/")[2]*1>0) && (ls.split("/")[2]*1<32))
{
id = 1;
}
}
}
}
if(id==0)
{
alert("日期格式不正确! 正确格式为:yyyy/mm/dd");
varthis.focus();
}
return id;
}
function checkintinput()
{
if ((event.keyCode >= 48 && event.keyCode <= 57 ))
event.returnValue = true;
else
event.returnValue = false;
}
function checkdecinput(varthis)
{
if(event.keyCode==46)
{
if(varthis.value.indexOf('.')==-1) event.returnValue = true;
else event.returnValue = false;
}
else
{
if (event.keyCode >= 48 && event.keyCode <= 57 )
{
event.returnValue = true;
}
else
event.returnValue = false;
}
}
function checkdec(varthis,varint)
{
intallowed=varint;
fieldValue = varthis.value;
dectext = fieldValue.substring(0,fieldValue.indexOf('.'));
intlength = dectext.length;
if(fieldValue.indexOf('.')<0) intlength=fieldValue.length;
if (intlength > intallowed)
{
alert ("最多"+varint+"位整数,请重新输入数字.");
varthis.select();
varthis.focus();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -