Search code examples
magentoadminhtml

Add mailto functionality in admin field


How can i new field in admin filed that contain mailto functionality

$fieldset->addField('email', 'link', array(
    'label'     => Mage::helper('mumodule')->__('Email'),
    "target"=>"_blank",
    'mailto' => Mage::registry('mumodule')->getData('email'),
    'class'     => 'required-entry',
    'required'  => true,
    'name'      => 'title',
    ));

using this way i cant add functionality.

is it possible to add new filed with mailto functionality?


Solution

  • i achieve in simple way

    $fieldset->addField('email', 'link', array(
            'label'     => Mage::helper('mumodule')->__('Email'),
            'target'    => '_blank',
            'href'      => 'mailto:' . urlencode(Mage::registry('mumodule')->getData('email')),
            'class'     => 'required-entry',
        ));
    

    mailto: is part of the URL so it should be assigned in the href attribute: