Hello,
About a week ago I tried to use Zend_Form_Element_Captcha to render
basically captcha for my site registration form. The problem is when I
render a captcha I see two input elements. I fixed it with some css (hide
the second element). But when I submit the form I receive everytime same
error mesage: "Captcha value is wrong". Again I serached in google to find a
solution but this time without success. Do you have any idea what and where
is the problem. Here is my captcha element in Zend_Form extended class:
[code]
$captcha = new Zend_Form_Element_Captcha('captcha', array(
'captcha' => array(
'captcha' => 'Image',
'wordLen' => 1,
'timeout' => 300,
'imgUrl' => '../public/images/captcha/',
'imgDir' => 'images/captcha/',
'width' => 170,
'height' => 50,
'font' => 'fonts/captcha.ttf',
)));
$captcha->setLabel('Verification ');
$this->addElements(array($username, $password, $passwordRepeat,
$email, $firstName, $lastName, $captcha, $submit));
$this->setElementDecorators(array(
'ViewHelper',
array('Label'),
array(array('p' => 'HtmlTag'), array('tag' => 'p')),
));
$captcha->setDecorators(array(
'ViewHelper',
array('Label'),
array('Errors'),
array(array('p' => 'HtmlTag'), array('tag' => 'p', 'class' =>
'captcha')),
));
$this->setDecorators(array(
'FormElements',
'Form',
));[/code]
The second question is about Zend_Navigation.
I have two or three menus. Is it a good idea to split any of these menus in
individual xml files, or not? What is the best way to do that if the method
above is not good?
Thanks in advance, guys!
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Zend-Form-Element-Captcha-troubles-and-some-question-about-Zend-Navigation-tp3241661p3241661.html
Sent from the Zend Framework mailing list archive at Nabble.com.