Esempio n. 1
0
 public function init()
 {
     $this->addElement('text', 'name', array('label' => 'State Name :', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'You must enter the state name')))), 'decorators' => $this->elementDecorators));
     $region = new Application_Model_City();
     $arrRegion = $region->getCity("---select---");
     $this->addElement('select', 'cityId', array('label' => 'City :', 'style' => 'width: 100%;', 'TABINDEX' => '6', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select city')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $arrRegion));
     $region = new Application_Model_Region();
     $arrRegion = $region->getRegion("--select---");
     $this->addElement('select', 'regionId', array('label' => 'Region :', 'style' => 'width: 100%;', 'TABINDEX' => '6', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select region')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $arrRegion));
     $region = new Application_Model_Country();
     $arrRegion = $region->getCountry("--select---");
     $this->addElement('select', 'countryId', array('label' => 'Country :', 'style' => 'width: 100%;', 'TABINDEX' => '6', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $arrRegion));
     $region = new Application_Model_Continent();
     $arrRegion = $region->getContinent("--select---");
     $this->addElement('select', 'continentId', array('label' => 'Continent :', 'style' => 'width: 100%;', 'TABINDEX' => '6', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select continent')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $arrRegion));
     $this->addElement('submit', 'cmdSubmit', array('required' => false, 'ignore' => true, 'label' => 'Save', 'decorators' => $this->buttonDecorators));
 }