'refresh-captcha',
'class' => 'text-small' // .text-small { font-size: 0.85em; } - include in your CSS
]);
$this->template = '
{image} ' . $refresh_a . '
{input}
'; parent::init(); } /** * Register the refresh JS */ public function registerClientScript() { $view = $this->getView(); $view->registerJs(" $('#refresh-captcha').on('click', function(e){ e.preventDefault(); $('#verify-code img').yiiCaptcha('refresh'); }) "); parent::registerClientScript(); } }