Saturday, 9 November 2013

How to create selection box element in Zend Framework?

$required = new Zend_Validate_NotEmpty ();
$required->setType ($required->getType() | Zend_Validate_NotEmpty::INTEGER | Zend_Validate_NotEmpty::ZERO);

$country = $this->createElement('select','country');
$country->setLabel('Country')
->addValidator($required);

$country->setErrorMessages(array(
'isEmpty'=>'You should must select your country.'
));

$country->addMultioptions(array(

'0'=>'select',

'india' => 'India',

'sri lanka' => 'Sri Lanka',

'usa' => 'USA',

'pakistan' => 'Pakistan'

));

No comments:

How calulation total value for HTML input text?

<script> $j(document).ready(function(){ $j(":text").keyup(function(){ if (isNaN($j(this).val())) { alert(...