Magento – How to add WYSIWYG editor button editor in backend block form

adminformbackendmagento-1.9wysiwyg

when editing product there is wysiwyg button like this
wysiwyg editor button

this button will popup wysiwyg editor when you click it and the value goes to the field text with html tag, i've tried the solution in here, but it didnt work at all

is there a way to add it to one of my fieldset that goes like this

$fieldset->addField(
            'custom_field',
            'text',
            array(
                'name'   => 'custom_field0',
                'container_id' => 'attribute-custom0',
                'placeholder' => $this->__('Custom Attribute Field'),
        ));

Best Answer

Try Below Code:

$fieldset->addField(
            'custom_field',
            'editor',
            array(
                'name'   => 'custom_field0',
                'container_id' => 'attribute-custom0',
                'placeholder' => $this->__('Custom Attribute Field'),
                'config'    => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
                'wysiwyg'   => true,
        ));