Skip to content

Instantly share code, notes, and snippets.

@jgornick
Created September 1, 2009 21:09
Show Gist options
  • Save jgornick/179396 to your computer and use it in GitHub Desktop.
Save jgornick/179396 to your computer and use it in GitHub Desktop.
ZF: Captch Form Element Bug
http://www.zfforums.com/zend-framework-components-13/core-infrastructure-19/captcha-not-working-right-2577.html
## Add Element to Form [php]
<?php
public $captchaDecorators = array(
'ViewHelper'
);
$this->addElement('captcha', 'foo', array(
'label' => "Please enter the security code shown below to complete registration",
'decorators' => $this->captchaDecorators,
'required' => true,
'captcha' => array(
'captcha' => 'Dumb',
'wordLen' => 6,
'timeout' => 300
)
));
## Rendered HTML [html]
Please type this word backwards:
<b>2di9at</b>
<input id="foo-id" type="hidden" value="6b4f5253822d4f6bb4792beb33ef39a7" name="foo[id]"/>
<input id="foo-input" type="text" value="" name="foo[input]"/>
<input id="foo" type="text" value="6b4f5253822d4f6bb4792beb33ef39a7" name="foo"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment