Created
April 2, 2013 12:45
-
-
Save ScreamingDev/5291934 to your computer and use it in GitHub Desktop.
Mage - Adminhtml - Form fields (simple)
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
<?php | |
// text | |
$fieldset->addField('title', 'text', array( | |
'label' => Mage::helper('form')->__('Title3'), | |
'class' => 'required-entry', | |
'required' => true, | |
'name' => 'title', | |
'onclick' => "alert('on click');", | |
'onchange' => "alert('on change');", | |
'style' => "border:10px", | |
'value' => 'hello !!', | |
'disabled' => false, | |
'readonly' => true, | |
'after_element_html' => '<small>Comments</small>', | |
'tabindex' => 1 | |
)); | |
// textarea | |
$fieldset->addField('textarea', 'textarea', array( | |
'label' => Mage::helper('form')->__('TextArea'), | |
'class' => 'required-entry', | |
'required' => true, | |
'name' => 'title', | |
'onclick' => "", | |
'onchange' => "", | |
'value' => '<b><b/>', | |
'disabled' => false, | |
'readonly' => false, | |
'after_element_html' => '<small>Comments</small>', | |
'tabindex' => 1 | |
)); | |
// time | |
$fieldset->addField('time', 'time', array( | |
'label' => Mage::helper('form')->__('Time'), | |
'class' => 'required-entry', | |
'required' => true, | |
'name' => 'title', | |
'onclick' => "", | |
'onchange' => "", | |
'value' => '12,04,15', | |
'disabled' => false, | |
'readonly' => false, | |
'after_element_html' => '<small>Comments</small>', | |
'tabindex' => 1 | |
)); | |
// dropdown (can be more complex) | |
$fieldset->addField('select', 'select', array( | |
'label' => Mage::helper('form')->__('Select'), | |
'class' => 'required-entry', | |
'required' => true, | |
'name' => 'title', | |
'onclick' => "", | |
'onchange' => "", | |
'value' => '1', | |
'values' => array('-1'=>'Please Select..','1' => 'Option1','2' => 'Option2', '3' => 'Option3'), | |
'disabled' => false, | |
'readonly' => false, | |
'after_element_html' => '<small>Comments</small>', | |
'tabindex' => 1 | |
)); | |
// radio | |
$fieldset->addField('radio2', 'radios', array( | |
'label' => Mage::helper('form')->__('Radios'), | |
'name' => 'title', | |
'onclick' => "", | |
'onchange' => "", | |
'value' => '2', | |
'values' => array( | |
array('value'=>'1','label'=>'Radio1'), | |
array('value'=>'2','label'=>'Radio2'), | |
array('value'=>'3','label'=>'Radio3'), | |
), | |
'disabled' => false, | |
'readonly' => false, | |
'after_element_html' => '<small>Comments</small>', | |
'tabindex' => 1 | |
)); | |
// submit | |
$fieldset->addField('submit', 'submit', array( | |
'label' => Mage::helper('form')->__('Submit'), | |
'required' => true, | |
'value' => 'Submit', | |
'after_element_html' => '<small>Comments</small>', | |
'tabindex' => 1 | |
)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment