Hi,
Simple question,
There is a nice Bootbox extension libary included in YiiBuster.
Documentation about its modal ‘confirm’ dialog is as here:
bootbox.confirm(str message, fn callback)
So, normal use is as follows:
$this->widget('bootstrap.widgets.TbButton', array(
'buttonType'=>'warning',
'label'=>'Confirmator',
'htmlOptions'=>array(
'onclick'=>'js:bootbox.confirm("Are you sure?",
function(confirmed){alert("It was confirmed!");})',
),
));
Well - this is nice, but… how to use this for instance for ‘reset’ type button - to prevent incidental form resets? How to return anything from callback function?
So, I am looking for Bootbox equivalent of:
$this->widget('bootstrap.widgets.TbButton', array(
'buttonType'=>'reset',
'label'=>'Confirmator',
'htmlOptions'=>array(
'onclick'=>'js:return confirm("Are you sure?")',
),
));
Any idea?