follow up question: How can I add a custom error message to the Captcha Element? In order to change the validator message I have to getValidator() but in this case I didn't define any... so how can I change the message?
Thanks! -----Ursprüngliche Nachricht----- Von: Mike Rötgers [mailto:[email protected]] Gesendet: Donnerstag, 18. Dezember 2008 19:23 An: [email protected] Betreff: Re: [fw-general] setOptions in reCaptcha form element I had the same problem. Maybe there is a more elegant way ... however, this works for me: $form->getElement('captcha')->getCaptcha()->getService()->setOption('theme', 'clean')->setOption('lang', 'de'); Kind regards Mike Markus Hausammann schrieb: > Hi > I'm implementing recaptcha but I would like to change the theme and the > language. > > Here is how I create the form element: > > $captcha = new Zend_Form_Element_Captcha('challenge', array( > 'captcha' => 'ReCaptcha', > 'captchaOptions' => array( > 'captcha' => 'ReCaptcha', > 'privKey' => $config->recaptcha->private, > 'pubKey' => $config->recaptcha->public) > )); > > now I would like to pass the options to the service: array('theme' => > 'clean', 'lang' => 'de') > > I tried several ways but couldn't make it work. How can I access the adapter > and pass the options? > I know there is a method setOptions() for the service but how can I get the > service if I have instantiated the form element? > > Thanks!! > Markus > >
