Captcha reload problem
I want a link on my user add page to reload a captcha. This is the
code I have in the add.ctp view file:
<div id="captchaID">
<?php echo $this->Html->image($this->Html-
>url(array('controller'=>'users', 'action'=>'captcha'),
true), array('style'=>'','vspace'=>2)); ?>
</div>
<?php echo $this->Js->link('Can not read this code? Reload.',
'reload_captcha', array('update'=>'captchaID')); ?>
... and in my controller:
function captcha() {
$code = $this->Utils->captcha_code();
$this->Utils->render_captcha($code);
$this->Session->write('captcha_code', $this->hash_captcha($code));
}
function reload_captcha() {
$this->captcha();
}
This reloads the captcha, but the captcha is on its own, not in the
form e.g. I have lost the form, it is not redrawn. How can I get the
form to remain?
Thanks.
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home