如何在管理表单中添加按钮?
How to add a button in admin form?
我在管理表单中添加了一个按钮,如下所示。
$fieldset->addField('registered', 'button', array(
'label' => Mage::helper('core')->__('Send e-mail to all registered customers'),
'value' => Mage::helper('core')->__('Button Caption'),
'name' => 'registered',
'onclick' => "setLocation('{$this->getUrl('*/*/registeremail')}')",
));
该字段的功能正常,但按钮显示不正确。显示如下。
如何将此按钮显示为普通的 magento 按钮?
我试过
'after_element_html' => '<button type="button" onclick="setLocation('{$this->getUrl('*/*/registeremail')}')">All Registered</button>'
但是onclick调用错误
尝试
$fieldset->addField('registered', 'button', array(
'label' => Mage::helper('core')->__('Send e-mail to all registered customers'),
'value' => Mage::helper('core')->__('Button Caption'),
'name' => 'registered',
'class' => 'form-button',
'onclick' => "setLocation('{$this->getUrl('*/*/registeremail')}')",
));
这对我有用。
我在管理表单中添加了一个按钮,如下所示。
$fieldset->addField('registered', 'button', array(
'label' => Mage::helper('core')->__('Send e-mail to all registered customers'),
'value' => Mage::helper('core')->__('Button Caption'),
'name' => 'registered',
'onclick' => "setLocation('{$this->getUrl('*/*/registeremail')}')",
));
该字段的功能正常,但按钮显示不正确。显示如下。
如何将此按钮显示为普通的 magento 按钮?
我试过
'after_element_html' => '<button type="button" onclick="setLocation('{$this->getUrl('*/*/registeremail')}')">All Registered</button>'
但是onclick调用错误
尝试
$fieldset->addField('registered', 'button', array(
'label' => Mage::helper('core')->__('Send e-mail to all registered customers'),
'value' => Mage::helper('core')->__('Button Caption'),
'name' => 'registered',
'class' => 'form-button',
'onclick' => "setLocation('{$this->getUrl('*/*/registeremail')}')",
));
这对我有用。