I am using Laravel 5.3. I know how to use Developer Console, but don't know to use it When using Laravel. I am new to Laravel. Here I am trying to submit form, but .submit() of jQuery not working. I don't want to use AJAX. I am using SweetAlert.
Form
<form id="formDelete" action="" method="post">
<input type="hidden" name="id" value="">
<button type="button" id="buttonDelete" class="btn btn-danger">Delete</button></li>
</form>
jQuery
$('#buttonDelete').click(function(){
swal({
title:"Please Confirm!",
text:"This will delete the record",
type:"warning",
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes, Delete It",
cancelButtonText: "No, Keep It",
cancelButtonClass: "btn-success",
showCancelButton: true,
closeOnCancel: true
},function(isConfirm){
if (isConfirm) {
$('#formDelete').submit();
alert('Here');
} else {
alert('Not Here');
}
});
});
Route
Route::delete('/employee/deleteWork', 'EmployeeController@deleteWork');
Controller Function
public function deleteWork(Request $request)
{
$id = $request->input('id');
echo "<pre>";
echo $id;
}
Routes & Controller are for mention only (not primary problem). When I confirm delete, .submit() method does not work but alert get executed.
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lf3ttF
via IFTTT
Aucun commentaire:
Enregistrer un commentaire