首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

jquery dialog validate解决方法

2013-09-06 
jquery dialog validate以下代码,如果我试用把屏蔽的dialog去掉,alert为false。如果加上dialog的话,alert为

jquery dialog validate
以下代码,如果我试用把屏蔽的dialog去掉,alert为false。如果加上dialog的话,alert为true。
哪位大大能跟我说下,这是什么原因啊?


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>登录</title>
    <link type="text/css" rel="stylesheet" href="css/smoothness/jquery-ui-1.10.3.custom.css" />   
    <script src="js/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="js/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
    <script src="js/jquery.validate.js" type="text/javascript"></script>
    <script src="js/login.js" type="text/javascript"></script>
    <script type="text/javascript">    
    function flashImg(){
    document.getElementById("VcodeImg").src="code.aspx?"+Math.random();
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="login_div">
    <div id="login_step" title="登陆">
        <p>
            <label for="Account" class="label">用户名</label>
            <input type="text" id="txtAccount" name="txtAccount" class="login_txt" maxlength="20" />
        </p>
        <p>
            <label for="pwd" class="label">密码</label>
            <input type="password" id="txtPwd" name="txtPwd" class="login_txt" maxlength="20" />
        </p>
        <p>
            <label for="cod" class="label">验证码</label>
            <input type="text" id="txtCode" name="txtCode" class="login_txt" maxlength="4" style="width:50px;" />
            <img src="code.aspx" class="vcode_img" id="VcodeImg" onclick="flashImg()" />


        </p>
        <p>
            <input type="button" value="Login" onclick="login_submit()" />
        </p>
    </div>
    </div>
    </form>
</body>
</html>



login.js

$(document).ready(function(){

    $("#form1").validate({
            rules: {
                txtAccount: "required",
                txtPwd:"required"
            },
            messages:{
                txtAccount:"用户名不能为空",
                txtPwd:"密码不能为空"
            }
    }); 
  
//    $("#login_step").dialog({
//        autoOpen:true,
//        resizable:false,
//        draggable:false,
//        open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
//    })
})

function login_submit(){
    alert($("#form1").validate().form());
}
jquery vaildate dailog
[解决办法]
$("#login_step").dialog 的创建有语法错误,,为什么你用的方式和别人的不一样??

http://demo.jb51.net/js/jQueryDialog/

热点排行