gpt4 book ai didi

javascript - jquery 验证在 ie9、ie8、ie7、ie6 中不起作用

转载 作者:行者123 更新时间:2023-11-30 18:38:11 24 4
gpt4 key购买 nike

您好,我在我的应用程序中使用了 jquery 验证插件和 jquery。验证在 Firefox 中有效,但在任何 IE 版本中均无效。我不知道为什么。请帮忙

<html>
<head>

<script type="text/javascript" src="<?php echo $this->config->item('3rd'); ?>jquery/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="<?php echo $this->config->item('3rd'); ?>jquery/jquery.validate.js"></script>

<script>

var jq = jQuery.noConflict();

jq(document).ready(function(){

var x=jq("#test").validate({

rules: {
fname: {
required:true,
minlength: 3,
maxlength: 250
},
lname: {
required:true,
minlength: 3,
maxlength: 250
}
},

messages: {
fname: {
required: "Enter your Business Name",
minlength: "At least 3 characters long",
maxlength:"Maximum length allowed is 250 charactors"
},
lname: {
required: "Enter City",
minlength: "min length 3",
maxlength:"Max length 250"
}
}

});


});

</script>

</head>
<body>
<form action="" method="post" id="test">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" value="Submit" />
</form>

</body>
</html>

最佳答案

mm 我发现了问题。我认为 jquery-1.6.2.min.jsie 中无法使用 jquery 验证。我将其更改为 jquery-1.3.2.min.js 并且成功了,谢谢....

关于javascript - jquery 验证在 ie9、ie8、ie7、ie6 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7643418/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com