$(function() { $(document).on('submit', '#frm_inq', function() { if (form_val_chk($(this))) { var formData = new FormData($('#frm_inq')[0]); $.ajax({ async: false, type: 'POST', processData: false, contentType: false, dataType: 'json', data: formData, url: '/common/inquiry/inq_proc.php', success: function(resp){ alert(resp.message); if (resp.result == 'success') { location.href = '/'; } }, error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } }); } return false; }); $(document).on('submit', '#frm_cust', function() { if (form_val_chk($(this))) { $.ajax({ async: false, type: 'POST', dataType: 'json', data: $('#frm_cust').serialize(), url: '/common/inquiry/inq_proc.php', success: function(resp){ alert(resp.message); if (resp.result == 'success') { location.href = '/'; } }, error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } }); } return false; }); $(document).on('submit', '#frm_recu', function() { if (form_val_chk($(this))) { $.ajax({ async: false, type: 'POST', dataType: 'json', data: $('#frm_recu').serialize(), url: '/common/inquiry/inq_proc.php', success: function(resp){ alert(resp.message); if (resp.result == 'success') { location.href = '/'; } }, error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } }); } return false; }); });