首页 > 其他 > 详细

表单验证

时间:2018-11-11 18:13:53      阅读:131      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form id =‘f1‘ action="https://www.baidu.com" method="get">
    <div><input name="n1" type="text"></div>
    <div><input name="n2" type="password"></div>
    <div><input name="n3" type="text"></div>
    <div><input name="n4" type="text"></div>
    <div><input name="n5" type="text"></div>
    <input type="submit" value="提交">
</form>
<script src="jquery1.9.js"></script>
<script>
    $(:submit).click(function () {

        $(#f1).find(input[type="text"],input[type="password"]).each(function () {
            var v=$(this).val();
            console.log(1)
            if(v.length<=0){
                return false;
            }
        });
        console.log("haha");
        return false;
    });
</script>
</body>
</html>

 

    

表单验证

原文:https://www.cnblogs.com/bianzhuo/p/9942850.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!