There are two 'Submit' button and one of the button using preventdefault to perform checking and then unbind the submit and submit through the default event. It cannot detect which button been submitted.
I am using the statement below but it only works if there is one submit button. It will return blank page if there are two buttons.
$('form').unbind('submit').submit();
function.
{!! Form::open(['url' => '.....', 'id' => 'form']) !!}
e.preventDefault();
$.ajax({
type: 'GET',
url: 'check/'+'',
dataType: 'json',
success: function (data) {
if(data!=""){
swal({
........
},function (isConfirm) {
if(isConfirm){
$('form').unbind('submit').submit();
}
});
}
else{
$('form').unbind('submit').submit();
}
},
error: function (data) {
console.log('Error:', data);
}
});
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire