I'm using captcha in my zend_form.
$captcha_element = new Zend_Form_Element_Captcha(
'captcha',
array('label' => 'Write the chars to the field',
'captcha' => array(
'captcha' => 'Image',
'wordLen' => 6,
'timeout' => 300,
'font' => DOC_ROOT . '/data/fonts/Vera.ttf',
'imgDir' => $imagedir,
'imgUrl' => $umageurl
)
)
);
This generates:
<dt id="captcha-input-label">
<label for="captcha-input" class="required">Write the chars to the field</label>
</dt>
<dd id="captcha-element">
<img width="200" height="50" alt="" src="http://sitename.com/captcha/09dd951939c6cdf7fa28f2b7d322ea95.png">
<input type="hidden" name="captcha[id]" value="09dd951939c6cdf7fa28f2b7d322ea95" id="captcha-id">
<input type="text" name="captcha[input]" id="captcha-input" value="">
</dd>
However. - I need following instead (captcha elements are wrapped into some tags individually):
<dt id="captcha-input-label">
<label for="captcha-input" class="required">Write the chars to the field</label>
</dt>
<dd id="captcha-element">
<div><span>
<input type="text" name="captcha[input]" id="captcha-input" value="">
</span></div>
<div><span>
<img width="200" height="50" alt="" src="http://sitename.com/captcha/09dd951939c6cdf7fa28f2b7d322ea95.png">
<input type="hidden" name="captcha[id]" value="09dd951939c6cdf7fa28f2b7d322ea95" id="captcha-id">
</span></div>
</dd>
I can't figure out how would I do this. Can I accomplish this by using some custom decorators? or woud that involve custom captcha ?