Adding a confirm delete popup to Yii admin form

I wanted to share this bit I was able to get working today with my Yii application. Add the JavaScript confirm dialog to the “htmlOptions” array key as below –

<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'type'=>'striped bordered condensed',
			'htmlOptions'=>array('onclick'=>'return confirm("Are you sure?")'),
)); ?>

Leave a comment

Your email address will not be published. Required fields are marked *