我想在验证引擎验证成功后启动fancybox ....我正在使用的代码在下面提到....
<button type="button" class="addcncl" value="<s:message code='createMonitorProfile' />" name="createProfile" id="createProfile" ><s:message code='createMonitorProfile' /></button>
$("#createProfile").fancybox({
'titlePosition' : 'outside',
'overlayColor' : '#000',
'autoSize' : false,
'autoDimensions' :false,
'overlayOpacity' : 0.7,
'scrolling' :'yes',
});
$("#createProfile").bind("click", function() {
if($('#createMonitorProfileForm').validationEngine('validate')) {
//if this condition is true then I want to upload fancybox content
//with ajax request.
}
});
我得到的问题是我的fancybox在验证之前出现了......
答案 0 :(得分:0)
对我来说就像那样工作
if ($("#createMonitorProfileForm").validationEngine('validate')) {
console.log("form is ok");
}