Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZF][ZendFramework] 'required' w elementach formularza
Piotrbaz
post
Post #1





Grupa: Zarejestrowani
Postów: 55
Pomógł: 2
Dołączył: 15.09.2012

Ostrzeżenie: (0%)
-----


Witam,

Czy istnieje jakiś ogarnięty sposób na skuteczne dodanie atrybutu
  1. required="required"
do elementów formularza w Zend Framework 1.12?

->setRequired(true), ->setRequired('required'), 'required' => 'required' nie śmiga (IMG:style_emoticons/default/ohmy.gif)


Elementy tworzę tak:

  1. $this->addElement(new Zend_Form_Element_Select('name',
  2. array('label' => 'label',
  3. 'class' => 'styled-select',
  4. 'type' => 'select',
  5. 'filters' => array('StripTags'),
  6. 'validators' => array(array('Alnum', true)),
  7. 'multiOptions' => array(
  8. 'option1'=>'option1',
  9. 'option2'=>'option2',
  10. )
  11. )));



EDIT:

Zagadka rozwiązana (IMG:style_emoticons/default/smile.gif)

Na rzecz elementu trzeba wywołać
  1. ->setAttrib("required","required");




Ten post edytował Piotrbaz 31.07.2013, 22:50:13
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.12.2025 - 15:18