我有一个模式窗口工程很好,一个jquery窗体,验证了很好,但两个不工作在一起。我尝试过点击/直播活动的不同组合,似乎没有任何工作。只要我将模式窗口ID附加到表单容器,它就会工作。这是我的代码。我很沮丧,我真的希望你能帮助我!非常感谢你提前。我已经在这个几个小时没有进展。使用jQuery验证的模态窗口
var jQuery = jQuery.noConflict();
jQuery(document).ready(function() {
jQuery.validator.methods.NotEqual = function(value, element, param) {
return value != param;
};
jQuery('#submit').live('click',function() {
jQuery('form').submit();
});
jQuery('form').live("submit", function(event) {
jQuery("#contacts").validate({
errorPlacement: function(error, element) {},
errorContainer: "#PIErrorBox",
rules: {
name: {
required: true,
NotEqual: 'Name'
},
email: {
required: true,
email: true,
NotEqual: 'Email'
},
notes: {
required: true,
NotEqual: 'How Can I Help?'
}
},
submitHandler: function(form) {
jQuery(".button").hide();
var loader = jQuery('<img src="images/loading.gif" alt="loading..." class="loading">').insertAfter(".button");
var param = jQuery(form).serialize();
jQuery.ajax({
type: "POST",
url: "include/inc_sendmail.php",
data: param,
success: function() {
jQuery('#contacts').hide();
jQuery('#thankyou').show();
}
});
return false;
}
});
});
});
我真的很难得到的HTML发布,我得到的是空divs。这里是小提琴,这说明HTML:从http://bassistance.de/jquery-plugins/jquery-plugin-validation/
模态窗口代码http://jsfiddle.net/4kNVv/
使用jQuery验证库
莫代尔JS:http://ortalonline.com/js/fancyzoom.js
通过$ Z(称为'#ContactMeLink')fancyZoom();
非常感谢你的帮助:)
我可以请你看看你的html吗?模式代码在哪里? – mcgrailm
确定的事情,我现在添加它。谢谢! – Ortal