Magento Varien_Form: addField() which fields are possible?

forms, magento

Solution

The different form elements you can use are all found in lib/Varien/Data/Form/Element, you can find help using some of them at http://www.excellencemagentoblog.com/magento-admin-form-field

You can use textarea for a multiline textbox.

Problem

For Magento Backend I created a Varien_Form to display. ``` class MyNamespace_MyModule_Block_Adminhtml_MyModule_Edit_Tabs_Form extends Mage_Adminhtml_Block_Widget_Form { protected function _prepareForm() { $form = new Varien_Data_Form(); $this->setForm($form); $fieldset = $form->addFieldset('my_form', array('legend'=>'ABC')); $fieldset->addField('data', 'text', array( 'label' => 'My Textfield', 'name' => 'myTextField' )); return parent::_prepareForm(); } } ``` My question is now, which form fields are possible at all? You see the function addField() where it says 'text'? I heard of 'checkbox' and 'hidden'. But is there a list of all possible fields? Like Label or a textbox for more lines etc. Thanks a lot!

Original source