js 验证函数 加个class就能用

时间:2016/10/14 14:47:00来源:互联网 作者:flyso 点击: 2162 次

js 验证函数 加个class就能用

///*

var isVaild = true;

var errMsg = "";            

$(".required").each(function () {

    if ($(this).val().length == 0) {

        //alert(tip)

        errMsg =  $(this).prev().text() + "不能为空";

        //$('#' + id).focus();

        $(".btn_full").text("保存");

        isVaild = false;

        //console.log('111');

        return false;

    }

})

if (!isVaild)

{

    window.wxc.xcConfirm(errMsg, window.wxc.xcConfirm.typeEnum.info);

    return false;

}

//*/


Copyright © 2005 - 2016 flyso.cn. 飞搜 版权所有 鄂ICP备11002783号-3