Actually i solved it on another way
i modified the method
Libs_QuickForm::get_submit_form_href()
here it is:
public function get_submit_form_href($submited = true, $indicator = null, $prompt = null) {
if (is_array($prompt)) {
return ' href="javascript:void(0)" onClick="if(confirm(\'' . $prompt[0] . '\'))
{
' . $prompt[1] . '
' . $this->get_submit_form_js($submited, $indicator) . ' } else
{
' . $this->get_submit_form_js($submited, $indicator) . ' }"';
} else
return ' href="javascript:void(0)" onClick="' . $this->get_submit_form_js($submited, $indicator) . '" ';
}
and this is an example how to use:
$prompt = array(
'Are you sure????' //the question to confirm
, 'alert(\'OK!\')' // javascript executed when confirmed
);
Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href(true, null, $prompt));