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);
}
});
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2s0So3b
via IFTTT
Aucun commentaire:
Enregistrer un commentaire