Witam,
mam taki formularz:
$email_zwrotny = new Zend_Form_Element_Text('email_zwrotny');
$sprawa = new Zend_Form_Element_Select('sprawa');
$tresc = new Zend_Form_Element_Textarea('tresc');
$captcha = new Zend_Form_Element_Captcha(
'captcha', // This is the name of the input field
array('label' => 'Write the chars to the field', 'captcha' => array( // Here comes the magic... // First the type...
'captcha' => 'Image',
// Length of the word...
'wordLen' => 6,
// Captcha timeout, 5 mins
'timeout' => 300,
// What font to use...
'font' => './public/fonts/MS_Reference_Sans Serif.ttf',
// Where to put the image
'imgDir' => './public/images/captcha/',
// URL to the images
// This was bogus, here's how it should be... Sorry again :S
'imgUrl' => 'http://127.0.0.1/treetime4/public/images/captcha/',
)));
$submit = new Zend_Form_Element_Submit
('submit', array('class'=>'middle'));
$email_zwrotny ->setLabel('E-mail zwrotny:') // etykieta
->addFilter(new Zend_Filter_StripTags()) // filtruj funkcją StripTags()
->addFilter(new Zend_Filter_StringTrim()); // filtruj funkcją StringTrim()
$sprawa ->setLabel('Temat *:') // etykieta
->setRequired(true) // pole jest wymagane
->addMultiOption(null, null)
->addValidator(new Zend_Validate_NotEmpty(), true)
->addMultiOptions(array(1=>'Reklama', 2=>'Znalazłem/łam błąd na stronie', 3=>'Sprawy techniczne', 4=>'Nowe pomysły', 5=>'Inne')); $tresc ->setLabel('Treść *:') // etykieta
->setRequired(true) // pole jest wymagane
->addValidator(new Zend_Validate_NotEmpty(), true) // to pole nie może być puste
->addFilter(new Zend_Filter_StripTags()) // filtruj funkcją StripTags()
->addFilter(new Zend_Filter_StringTrim()); // filtruj funkcją StringTrim()
$captcha ->setLabel('Przepisz kod z obrazka *:')
->setRequired(true) // pole jest wymagane
->addValidator(new Zend_Validate_NotEmpty(), true); // to pole nie może być puste
//->addFilter(new Zend_Filter_StripTags()) // filtruj funkcją StripTags()
//->addFilter(new Zend_Filter_StringTrim()); // filtruj funkcją StringTrim()
$submit ->setLabel('Wyślij wiadomość');
a tak wygląda kontroler:
$form = new Contact();
if($this->_request->isPost()){
$postData = $this->_request->getPost();
if($form->isValid($postData)){
$formData = $form->getValues();
Zend_Debug::dump($formData);
// forumlarz wypełniony poprawnie
}
}
$this->view->form = $form;
No i teraz pytanie: dlaczego poprawnie sprawdza mi wszystkie pola poza Captchą? Zawsze pojawia się "Captcha value is wrong"

Poradźcie coś...