« Return to Thread: Zend_Form_Element_Captcha doesn't works as expected !

Zend_Form_Element_Captcha doesn't works as expected !

by SŽébastien Cramatte :: Rate this Message:

Reply to Author | View in Thread

Hello,

I'm trying to create a captcha with Image.
It practically works excepts that I see the image and 2 fields ...

I'm using ZF 1.8.0

This the generated code :

<div class="field"><label for="captcha" class="required">are_you_human</label>

<img alt="" src="/share/img/captchas/631567244e675bdf5ec0abbb61b6fe58.png"/><br/>
<input type="hidden" name="captcha[id]" value="631567244e675bdf5ec0abbb61b6fe58" helper="formText" id="captcha-id">
<input type="text" name="captcha[input]" id="captcha-input" value="" helper="formText">
<input type="text" name="captcha" id="captcha" value="631567244e675bdf5ec0abbb61b6fe58"></div>

As you can see Zend_Form render a third field ... Why ????
And in my Zend_Form class I initialize the element like this

 $elt = new Zend_Form_Element_Captcha('captcha', array(
         'label' => "are_you_human",
         'captcha' => array(
         'captcha' => 'Image',
         'wordLen' => 6,
         'timeout' => 300,
         'font' => './share/fonts/verdana.ttf',
         'imgDir' => './share/img/captchas/',
         'imgUrl' => '/share/img/captchas/',
         )
        ));

  $this->addElement($elt);

What I've missed ... It's making me crazy
Thank you for you help

Regards

 « Return to Thread: Zend_Form_Element_Captcha doesn't works as expected !