Example #1
0
 public function init()
 {
     $this->addElementPrefixPath('Base_Validate', 'Base/Validate/', 'validate');
     $this->setName('incoming_cows');
     //        $this->addElementPrefixPath('Base_Decorator',
     //                            'Base/Decorator/',
     //                            'decorator');
     $model = new Admin_Model_Supplier();
     $arrGroup = $model->getAllSuppliers(1);
     // print_r($arrGroup);die();
     $this->addElement('select', 'supplierId', array('label' => 'Select Supplier:', 'id' => 'supplierId', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select Supplier.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $arrGroup));
     //$arrSubgroup	=	array("0"=>"Sub Group");
     $this->addElement('text', 'noCows', array('label' => 'Select Number of Cows:', 'id' => 'noCows', 'class' => 'spinbutton_input', 'required' => false, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select number of Cows.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     // Add an first name element
     $this->addElement('text', 'description', array('label' => 'Antimortum Information:', 'class' => 'text-input medium-input', 'required' => true, 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim')));
     $this->addElement('submit', 'submit', array('required' => false, 'class' => 'button', 'ignore' => true, 'label' => 'Submit', 'value' => 'submit', 'decorators' => $this->buttonDecorators));
 }