bootbox не ждет подтверждения

Я новичок в использовании плагина bootbox ..

когда я нажимаю кнопку удаления, он не ждет подтверждения загрузочной коробки .. он просто выполняет мой код удаления …

Вот мой код:

Jquery

$('.cmd_delete_location').click(function(e){
$this=$(this);
bootbox.confirm("Are you sure?", function(result){
if(result)
{
form = $this.parent();
form.submit();
}
});
});

HTML

 <form method="post">
<button type="submit" class="btn btn-success" title="Update Location" value="<?=$loc['LocationID']?>" name="cmd_update_location"><i class="fa fa-edit fa-fw"></i></button>
<button type="submit" class="btn btn-danger cmd_delete_location" title="Delete Location" value="<?=$loc['LocationID']?>" name="cmd_delete_location"><i class="fa fa-trash fa-fw"></i></button>
</form>

PHP

    if(isset($_POST['cmd_delete_location'])){
// echo $LocationID = $this->input->post('hidden_id');
$LocationID = $this->input->post('cmd_delete_location');
$location_used_in_other_transaction = $this->main_m->get_where('temperaturelogs', array('LocationID' => $LocationID));
if($location_used_in_other_transaction)
{
$_SESSION['type'] = "warning";
$_SESSION['message'] = "Unable to Delete: Location is already used in other transaction!";
redirect(current_url());
}else{
$this->main_m->delete_data('locations', array('LocationID' => $LocationID));
$_SESSION['type'] = "success";
$_SESSION['message'] = "Location's Successfully Deleted!";
redirect(current_url());
}
}

заранее спасибо..

1

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …