
var reg_number = /^(0|[1-9]\d*)$|^(0|[1-9]\d*)\.(\d+)$/;
function checknull(containid) {
    var checknull_result = true;
    var Obj1;
    if (containid == '') Obj1 = document.getElementsByTagName("INPUT");
    else {
        var contain = document.getElementById(containid);
        Obj1 = contain.getElementsByTagName("INPUT");
    }
    for (var i = 0; i < Obj1.length; i++) {
        if (Obj1[i].type == "text") {
            if (Obj1[i].value == "" && Obj1[i].type != "hidden" && Obj1[i].type != "submit") {
                checknull_result = false;
                alert("请填写" + Obj1[i].title + "！");
                Obj1[i].focus();
                break;
            }

        }

    } //for_end
    if (checknull_result) {
        for (var i = 0; i < Obj1.length; i++) {
            if (Obj1[i].type == "text") {
                if (!reg_number.test(Obj1[i].value)) {
                    checknull_result = false;
                    alert("输入的" + Obj1[i].title + "格式不正确！");
                    Obj1[i].focus();
                    break;
                }

            }

        }
    }
    return checknull_result;
}
