我想调用块中模板文件中的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;
}
答案 0 :(得分:0)
document.getElementById("submit_button").onclick = function () {
yourJavascriptFunc();//Calling your javascript function when slicks the submit button
};