tags:

views:

83

answers:

2

in a custom module with admin pages, in the file
app\code\local\Namespace\Mymodulw\Block\Myblock\Edit\Tab\Form.php you can add somthing like this

$fieldset->addField('title', 'text', array(
        'label'     => Mage::helper('mymodule')->__('Title'),
        'class'     => 'required-entry',
        'required'  => true,
        'name'      => 'title',
    ));

this create an input of type text in the edit page, what i'm trying to do is create a new type, then i can make something like this

$fieldset->addField('title', 'mytype', array(
        'label'     => Mage::helper('mymodule')->__('Title'),
        'class'     => 'required-entry',
        'required'  => true,
        'name'      => 'title',
    ));

can you see the diference?? thanks

A: 

Mage::helper('mymodule') to Mage::helper('Mymodule') ????

Seeal
sorry about that erro, but isn't what i'm talking, is this
Kstro21
sorry for that error, addField('title', 'text' to $fieldset->addField('title', 'mytype',
Kstro21
A: 

The adminhtml field types extend Varien_Data_Form_Element_Abstract and are located in \lib\Varien\Data\Form\Element. So you would need to create a new file called Mytype.php with a declaration of class Varien_Data_Form_Element_Mytype extends Varien_Data_Form_Element_Abstract and then override the Abstract methods to function as you need.

Check out the files in that directory for examples.

Cheers, JD

Jonathan Day
thanks, really help me, although i'm stuck creating my first one
Kstro21