/*********************************************
 1
*function isEmpty (items)
 2*isEmpty的作用是判断表单内的任一项值是否为空
 3*参数items是一个对象,
 4*如果有任一个为空,返回false。如果全不为空,返回true
 5items对象形式如下:
 6var items;
 7items = {        "name" : "登录名不能为空",
 8                        "password" : "密码不能为空",
 9                        "confirmpwd" : "确认密码不能为空",
10                        "email" : "电子信箱不能为空",
11                }

12
13*******************************************/
14function isEmpty(items)
15{
16        var key = '';
17        for (key in items)
18        {
19                if ( document.getElementById(key).value == '')
20                {
21                        alert(items[key]);
22                        document.getElementById(key).focus();
23                        return false;
24                }

25        }

26        return true;        
27}
posted on 2007-09-21 10:01  南极陨石  阅读(188)  评论(0)    收藏  举报