Jquery - 验证插件 - 错误消息帮助 +
我无法让它发挥作用。说真的,我已经准备好吃掉我的键盘了。这个“答案”似乎对除了我之外的每个人都有效,这让我相信我是一个彻底的shmoe。
我需要所有错误消息消失。不在那里。阿迪奥斯。被忽略。我想做的就是在错误输入罪犯周围贴上红色边框,我已经完成了这一点(有一个例外,但我会在回答/澄清这件事后询问)
好的,现在开始编写代码。
<script type="text/javascript">
$(document).ready(function(){
$("#pmpcontform").validate();
});
</script>
上面的工作正常,但是当我尝试添加下面的神奇行以删除所有错误消息时,验证不再存在。它会简单地进入确认页面,告诉我填写表格是多么高兴。
<script type="text/javascript">
$(document).ready(function(){
$('#pmpcontform').validate({
errorPlacement: function(error, element) {
return true;
});
</script>
我知道。这将是一些我看不到的括号。请告诉我就是那个。
编辑:
我看到 2 个丢失的括号(是括号,对吗?)我不知道在哪里关闭它们。我看过 20 个例子。问题是我对JS不熟悉。那,我是Shmoe。
I can't get this to work. I'm ready to eat my keyboard, seriously. This "answer" seems to work for everyone but me, which leads me to believe that I'm a complete shmoe.
I need ALL error messages GONE. NOT THERE. ADIOS. IGNORED. All I want to do is stick a red border around the error input offender, which I've accomplished (with one exception, but I'll ask that after I have this thing answered/clarified)
Ok, now on to the code.
<script type="text/javascript">
$(document).ready(function(){
$("#pmpcontform").validate();
});
</script>
Above works just fine, however when I try to add the magical line, below, to remove all errors messages, validation is no longer there. It will simple head on out the door to a confirmation page telling me how nice it was of me to fill out the form.
<script type="text/javascript">
$(document).ready(function(){
$('#pmpcontform').validate({
errorPlacement: function(error, element) {
return true;
});
</script>
I know. It's going to be some bracket I'm not seeing. Please tell me it's that.
Edit:
I see the 2 missing brakcets (it's the brakets, correct?) I have no idea where to close them. I've looked at 20 examples. The problem is I'm not familiar with JS. That, and I'm a Shmoe.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它的一些括号你没有看到^_^尝试这个:
its some bracket you are not seeing ^_^ try this: