문제

리튬 HTML 도우미 링크가 있습니다

<?php echo $this->html->link('Delete', array('action' => 'delete', 'args' => $id); ?>
.

이 링크를 클릭하면 확인란을 표시하고 싶습니다.하지만 설명서를 허용 할 수있는 문서에서 아무 것도 볼 수 없습니다.

이이 가능합니까?

도움이 되었습니까?

해결책

DVIR VOLK에서 제공하는 것처럼 다음을 사용하여 해결할 수 있습니다.

<?php echo $this->html->link('Delete', array('action' => 'delete', 'args' => $id), array('onclick', 'return confirm("Are you sure you wish to delete this item?")'); ?>
.

다른 팁

jQuery를 사용하여 이벤트를 추가합니다.

<?php echo $this->html->link (
    'Delete', 
    array(
        'action' => 'delete', 
        'args' => $id, 
        'class' => 'delete'
    )
); ?>

<script>
    $('a.delete').click(function(){
        confirm("Are you sure you wish to delete this item?");
    });
</script>
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top