$('#mc_custom_frm').submit(function(e){
e.preventDefault();
var submit_data = $('#mc_custom_frm').serialize();
jQuery.ajax({
type:"POST",
url: site_vars.site_ajax_url, //ajax URL is accessed here
data: 'action=mc_submit&'+submit_data,
dataType: 'json',
success:function(data){
console.log(data);
if(data.status=='not_ok'){
$('#mc_custom_response').addClass('custom_error');
// $('#mc_custom_response').html('<ul>'+data.msg+'</ul>');
$('#custom_mce_fname').addClass('cstm_err');
$('#custom_mce_email').addClass('cstm_err');
}else{
$('#mc_custom_response').removeClass('custom_error');
// $('#mc_custom_response').html('<ul>'+data.msg+'</ul>');
$('.h_newl_r_inner').hide();
$('.h_newl_r_inner_after_submit').show();
$('#custom_mce_fname').removeClass('cstm_err');
$('#custom_mce_email').removeClass('cstm_err');
}
},
});
});
$('#mc_custom_frm').submit(function(e){
e.preventDefault();
var submit_data = $('#mc_custom_frm').serialize();
jQuery.ajax({
type:"POST",
url: site_vars.site_ajax_url, //ajax URL is accessed here
data: 'action=mc_submit&'+submit_data,
dataType: 'json',
success:function(data){
console.log(data);
if(data.status=='not_ok'){
$('#mc_custom_response').addClass('custom_error');
// $('#mc_custom_response').html('<ul>'+data.msg+'</ul>');
$('#custom_mce_fname').addClass('cstm_err');
$('#custom_mce_email').addClass('cstm_err');
}else{
$('#mc_custom_response').removeClass('custom_error');
// $('#mc_custom_response').html('<ul>'+data.msg+'</ul>');
$('.h_newl_r_inner').hide();
$('.h_newl_r_inner_after_submit').show();
$('#custom_mce_fname').removeClass('cstm_err');
$('#custom_mce_email').removeClass('cstm_err');
}
},
});
});