【问题标题】:How to Make a Status Field Bydefault Enable in Magento Form?如何在 Magento 表单中默认启用状态字段?
【发布时间】:2017-06-07 06:24:48
【问题描述】:

以下是我的表单域代码。

$fieldset->addField('status','select', 
    array(
    'label'  => Mage::helper('synclogin')->__('Eshot Status'),
    'name'   => 'status',
    'values' => array(
        array(
        'value' => 0,
        'label' => Mage::helper('synclogin')->__('Disabled'),
        ),
         array(
        'value' => 1,
        'label' => Mage::helper('synclogin')->__('Enabled'),
       ),
    ),
    )
);

如何在 Magento 表单中默认启用状态字段?

【问题讨论】:

    标签: magento magento-1.9


    【解决方案1】:
    $fieldset->addField('status','select', 
        array(
        'label'  => Mage::helper('synclogin')->__('Eshot Status'),
        'name'   => 'status',
        'value'  => '1',
        'values' => array(
            array(
            'value' => 0,
            'label' => Mage::helper('synclogin')->__('Disabled'),
            ),
             array(
            'value' => 1,
            'label' => Mage::helper('synclogin')->__('Enabled'),
           ),
        ),
        )
    );
    

    【讨论】:

    • 如果您能解释您所做的更改,包括它们是什么以及它们回答问题的原因,将会很有帮助。
    猜你喜欢
    • 1970-01-01
    • 2012-05-21
    • 1970-01-01
    • 2013-02-09
    • 2015-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-16
    相关资源
    最近更新 更多