0

我想调用块模板文件中的 JavaScript 函数。该块具有以下按钮。对于该按钮的 onclick 事件,我想调用该 JavaScript 函数。怎么做?

块按钮如下。

protected function _prepareLayout()
    {
        $onclick = "submitAndReloadArea($('order_history_block').parentNode, '".$this->getSubmitUrl()."')";
        $button = $this->getLayout()->createBlock('adminhtml/widget_button')
            ->setData(array(
                'label'   => Mage::helper('sales')->__('Submit Comment'),
                'class'   => 'save',
                'onclick' => $onclick
            ));
        $this->setChild('submit_button', $button);
        return $this;
    }
4

1 回答 1

0
document.getElementById("submit_button").onclick = function () { 
    yourJavascriptFunc();//Calling your javascript function when slicks the submit button
};
于 2013-04-17T12:08:43.870 回答