我正在使用Html :: submitButton作为删除按钮,按下删除按钮后需要确认消息。
<?= Html::submitButton('Delete', ['name' => 'delete', 'value' => 0, 'id' => 'delete1', 'class' => 'pull-left btn btn-danger']) ?>
有人知道怎么做吗?
答案 0 :(得分:1)
尝试以下代码:
<?= Html::submitButton('Delete', ['name' => 'delete', 'value' => 0, 'id' => 'delete1', 'class' => 'pull-left btn btn-danger', 'data-confirm' => 'Are you sure you want to delete this item?']) ?>
或
<?= Html::submitButton('Delete', ['name' => 'delete', 'value' => 0, 'id' => 'delete1', 'class' => 'pull-left btn btn-danger', 'confirm' => 'Are you sure you want to delete this item?']) ?>