我有 jQuery 通知根据某些选择发布警告消息:我需要做的是在警告/通知消息出现时不提交表单。只有当错误解决后,才提交表单。
$('.Reason').change(function(event)
{
var id = $(this).data('item-id');
var sPrice = $(this).data('price');
var reason = $(this).val();
var aPrice = $(this).data('aPrice');
if (reason > 0 && (aPrice == sPrice)){
$('##' + id).notify(
{
title: 'Warning',
text: "Both pricing can't match, Please fix before conitniuing.",
image: '<i class="fa fa-2x fa-exclamation-circle"></i>'
},
{
style: 'cosentino',
className: 'error',
position: 'top center',
clickToHide: true,
autoHide: false
});
}
$('##frmJobEntry').validate(
{
errorClass: 'JoblineInlineError'
});