易截截图软件、单文件、免安装、纯绿色、仅160KB

javascript验证3

/*
    限制输入字符的位数
    str是用户输入字符串,len是要限制的位数
    ----------------------------
*/
function isSmall(str,len){
    if (str.length<len){
        return(true);
    }else{
        return(false);
    }
}
/*判断两个字符串是否一致
---------------------------------
*/
function isSame(str1,str2){
    if (str1==str2){
        return(true);
    }else{
        return(false);
    }
}
/*
判断字符串是否为空开始
---------------------------------
*/
function isNotNull(str){
    if (str.length==""){
        return(false);
    }else{
        return(true);
    }
}
/*
判断是不是手机号码
---------------------------------
*/
function isPhone(str){
    reg=/^[0]?13\d{9}$/gi;
    reg2=/^[0]?15\d{9}$/gi;
    if(!reg.test(str)&&!reg2.test(str)){
        return false;
    }
    return true;
}
/*
判断用户名是否不包含汉字
(用户名不能为汉字,也不准带有特殊字符)
注:
正则表达式.test() 方法用于检测一个字符串是否匹配某个模式
---------------------------------
*/
function notChinese(str){
var reg=/[^A-Za-z0-9_]/g
    if (reg.test(str)){
        return (false);
    }else{
        return(true);   
    }
}
/*
判断是否为日期
----------------------------------
*/
function isDate (theStr) {
    var the1st = theStr.indexOf('-');
    var the2nd = theStr.lastInde


相关文档:

event.keycode大全(javascript)

event.keycode大全(javascript)
keycode 8 = BackSpace BackSpace
keycode 9 = Tab Tab
keycode 12 = Clear
keycode 13 = Enter
keycode 16 = Shift_L
keycode 17 = Control_L
keycode 18 = Alt_L
keycode 19 = Pause
keycode 20 = Caps_Lock
keycode 27 = Escape Escape
keycode 32 = space space
......

JavaScript验证函数大全

1. 长度限制
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("不能超过50个字符!");
document.a.b.focus();
return false;
}
}
</script>
<form name=a onsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"></textarea& ......

Javascript 开发工具


Build your web applications quickly and easily using the industry leading web application IDE -- Aptana Studio.
Introduction:
Aptana Studio is a complete web development environment that combines powerful authoring tools for HTML, CSS, and JavaScript, along with thousands of additional plugins ......

javascript验证2

// JScript 文件
/********************************************************/
/*判定返回值为true或false*/
/********************************************************/
//打开一个新链接
function   openwindow()
  {
    //var $j = jQuery.noConflict();
    ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号