Edit: after some trouble with the spamfilter (about the word ’ v a l i d a t i n g’) I did succeed to post the complete question.
Hope someone can help
=========
Hi there,
I’m desperate what to do next because of - what I think is - a simple mistake. So I hope someone can help me.
I have a guestion about using captcha via renderPartial. I want to render a form from the the model Feedback on my frontpage, so in //site/index I:
echo $this->renderPartial('//feedback/_frontpage_form',
array( 'model' => new Feedback('insert'),
), true, true);
The problem is that in the way I tried I need twice the code:
public function actions()
{
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
),
);
Once in the SiteController and once in FeedbackController.
When I leave out the code in SiteController I don’t get the image, because index/site/capthca?v=. does not exists. When I leave out the code in the feedback controller, I retrieve the error when posting:
CCaptchaValidator.action captcha is invalid. Cannot find a comparable action in current controller
I figured out that this is probably because I use:
echo '<div class="row">'.
$form->labelEx($model,'verifyCode');
[b]$this->widget('CCaptcha');[/b]
echo $form->textField($model,'verifyCode') .
'</div>' .
'<div class="hint">Type aub het bovenstaande woord over.</div>'.
$form->error($model,'verifyCode');
$this->widget in the renderPartial view, and the $this is related to the SiteController, but I can not figure out how I can print a widget from another controller.
Is this a familiar problem for others and can you please help me with this problem?
Thank you so much in advance!
Reinier