Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8095891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:17:12+00:00 2026-06-05T21:17:12+00:00

I have a problem with captcha in my YII project. I included a captcha

  • 0

I have a problem with captcha in my YII project. I included a captcha in popup form. It’s showing correctly, but there’s a problem with the validation. The validation is true sometimes, if we entered the correct word in first attempt, the validation says it is wrong, after generating another code the validation succeeds. Why?

In model-> rules:

array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements(),'on'=> 'signup')

In controller -> calling the signup form via renderPartial

$this->renderPartial('signUp',array('model'=>$model),false,true);

In view :

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'sign-up-form',
    'enableAjaxValidation'=>true,
    'enableClientValidation'=>true,
    'clientOptions'=>array(
        'validateOnSubmit'=>true,
    ),
)); ?>

-----------------------
-----------------------

<?php if(CCaptcha::checkRequirements()): ?>                             
    <?php echo $form->labelEx($model, 'verifyCode', array('for'=>'User_security_code')); ?>
    <?php $this->widget('CCaptcha'); ?>     
    <?php echo $form->textField($model,'verifyCode',array('class'=>'txt-style width-289')); ?>
    Please enter the letters as they are shown in the image above. Letters are not case-sensitive.
    <?php echo $form->error($model,'verifyCode',array('class'=>'error_msg')); ?>
 <?php endif; ?>    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:17:14+00:00Added an answer on June 5, 2026 at 9:17 pm

    i added this in view

    <?php
    Yii::app()->clientScript->registerScript(
            'initCaptcha',
            '$("#yw0_button").trigger("click");',
            CClientScript::POS_READY);
    ?>
    

    and in

    `CCaptchaAction.php` updated `$testLimit = 0;` //for unlimted test`
    

    and the problem solved. I’m not sure about this is the right way, but for my current scenario it helped.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Probably something simple, but heres my problem, I have implememnted a simple captcha into
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have problem with repopulating form_upload after validation. Other input fields or selectboxes are
I have problem with show or hide form in Window Form Application. I start
I have created a captcha which looks like this: <img src=/cgi-bin/rand.pl /> The problem
I have a problem with my form,i have this error every time i want
Im using recaptcha but when the user type incorrect captcha i have an errror
I have this problem: No module named _imagingft I have installed PIL, but it
I have a variable called captcha from input in my form. In my javascript
I have a problem to validate my Facebook form. On custom input blur, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.