Protected Member Functions | |
_prepareForm () |
Definition at line 35 of file Form.php.
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 37 of file Form.php.
00038 { 00039 $form = new Varien_Data_Form(); 00040 00041 $fieldset = $form->addFieldset('edit_answer_form', array('legend' => Mage::helper('poll')->__('Edit Poll Answer'))); 00042 00043 $fieldset->addField('answer_title', 'text', array( 00044 'name' => 'answer_title', 00045 'title' => Mage::helper('poll')->__('Answer Title'), 00046 'label' => Mage::helper('poll')->__('Answer Title'), 00047 'required' => true, 00048 'class' => 'required-entry', 00049 ) 00050 ); 00051 00052 $fieldset->addField('votes_count', 'text', array( 00053 'name' => 'votes_count', 00054 'title' => Mage::helper('poll')->__('Votes Count'), 00055 'label' => Mage::helper('poll')->__('Votes Count'), 00056 'class' => 'validate-not-negative-number' 00057 ) 00058 ); 00059 00060 $fieldset->addField('poll_id', 'hidden', array( 00061 'name' => 'poll_id', 00062 'no_span' => true, 00063 ) 00064 ); 00065 00066 $form->setValues(Mage::registry('answer_data')->getData()); 00067 $form->setUseContainer(true); 00068 $form->setId('edit_form'); 00069 $form->setMethod('post'); 00070 $form->setAction($this->getUrl('*/*/save', array('id' => Mage::registry('answer_data')->getAnswerId()))); 00071 $this->setForm($form); 00072 }