示例#1
0
 public function init()
 {
     // Dojo-enable the form:
     //Zend_Dojo::enableForm($this);
     $cityM = new Application_Model_City();
     $citiesArr = $cityM->getCities(array("" => "--Select City--"));
     $countryM = new Application_Model_Country();
     $countryArr = $countryM->getCountry();
     /*
     $this->addElement('select', 'featured_top',array(
                 'label'      => 'Top Featured Place:',
             	'style'=>'width: 350px;',
             	'required'   => true,
             	'validators' => array(
                     	array('NotEmpty', true, array('messages'=>array('isEmpty'=>'Please select top featured place.')))
                 	),
             	'decorators' => $this->elementDecorators,
                 'filters'    => array('StringTrim'),
             	'MultiOptions'=>$citiesArr        	
             ));
     */
     $this->addElement('Multiselect', 'featured_other', array('label' => 'Featured Places/Cities:', 'style' => 'width: 350px;', 'size' => 10, 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select featured places/cities.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $citiesArr));
     $this->addElement('Multiselect', 'featured_country', array('label' => 'Featured Countries:', 'style' => 'width: 350px;', 'size' => 10, 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select featured countries.')))), 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $countryArr));
     $this->addElement('submit', 'cmdSubmit', array('required' => false, 'ignore' => true, 'label' => 'Save', 'decorators' => $this->buttonDecorators));
 }
示例#2
0
 public function init()
 {
     $this->addElement('text', 'name', array('label' => 'City Name:', 'class' => '', 'decorators' => $this->elementDecorators));
     $countryM = new Application_Model_Country();
     $countryArr = $countryM->getCountry("--- Select Country ---");
     $this->addElement('select', 'country_id', array('label' => 'Country:', 'style' => 'width: 250px;', 'decorators' => $this->elementDecorators, 'filters' => array('StringTrim'), 'MultiOptions' => $countryArr));
     $this->addElement('submit', 'submit', array('required' => false, 'ignore' => true, 'label' => 'Search', 'decorators' => $this->buttonDecorators));
 }
示例#3
0
 public function init()
 {
     $this->addElement('text', 'name', array('label' => 'Region Name :', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'You must enter the region name')))), 'decorators' => $this->elementDecorators));
     $country = new Application_Model_Country();
     $arrCountry = $country->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' => $arrCountry));
     $continent = new Application_Model_Continent();
     $arrContinent = $continent->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' => $arrContinent));
     $this->addElement('submit', 'cmdSubmit', array('required' => false, 'ignore' => true, 'label' => 'Save', 'decorators' => $this->buttonDecorators));
 }