Answer the question
In order to leave comments, you need to log in
Zend Framework 1. How to add an empty item select form?
Hello, I am creating a form with a drop-down list, but the form is created all filled with values, and I did not find how to create the form correctly, so that with a standard empty first select item, for example, with the inscription "Select ..."
Answer the question
In order to leave comments, you need to log in
Zend Framework 2 has a .
framework.zend.com/manual/current/en/modules/zend....
Empty_option.
In Zend Framework 1, it's a little more complicated:
$select = new Zend_Form_Element_Select('select');
$select->setMultiOptions(array(
-1 => 'Выберите...',
0 => 'Значение 0',
1 => 'Значение 1',
1 => 'Значение 2',
));
$select->addValidator(new Zend_Validate_GreaterThan(-1), false);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question