Last active
August 29, 2015 14:16
-
-
Save tinchodev/0dd5c123a4ae717feb57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$form = new Varien_Data_Form(); | |
$form->addField('yesno', 'select', array( | |
'label' => $this->__('Yes or No?'), | |
'values' => Mage::model('adminhtml/system_config_source_yesnocustom') | |
->toOptionArray(), | |
)); | |
$form->addField('custom_value', text, array( | |
'label' => $this->__('Other'), | |
)); | |
// Append dependency javascript | |
$this->setChild('form_after', $this->getLayout() | |
->createBlock('adminhtml/widget_form_element_dependence') | |
->addFieldMap('yesno', 'yesno') | |
->addFieldMap('custom_value', 'custom_value') | |
->addFieldDependence('custom_value', 'yesno', 2) // 2 = 'Specified' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment