in custom form, captcha added, Form submit via AJAX,

Issue reproduce step

step 1: form display captcha1+5=?
step 2: i entered "4"
step 3: system said, captchafailed, enter valid number
step 4: form displayed captcha1+5=?
step 5: i entered "6"
step 6:system still saying, captchafailed, enter valid number

Please let me know, actual issue.

my observation is, in screen behind, new captcha generated, but system unable to display newly generated captcha.

please suggest the best solution

module: captcha 7.x-1.3

function home_page_post_form($form, &$form_state) {
    $form = array();
    $form["wrapper"] = array(
      "#markup" => "<div id='test-ajax'></div>"
      );
    $form['txt_title'] = array(
      '#title' => t('Post title'),
      "#required" => true,
      '#type' => 'textfield',
      );
    $form['txt_desc'] = array(
      '#title' => t('Post description'),
      '#type' => 'textarea',
      );
    $form['captcha'] = array(
      '#type' => 'captcha',
      '#captcha_type' => 'captcha/Math',
      '#tree'=>true,
      );
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Submit'),
      "#ajax" => array(
        "callback" => "dr_search_test_form_callback",
        "wrapper" => "test-ajax",
        "effect" => "fade")
      );
    return $form;
}
CommentFileSizeAuthor
drupal-capcha.PNG4.76 KBganeshfriends
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ganeshfriends created an issue. See original summary.

Chris Matthews’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Priority: Critical » Normal
Status: Needs work » Active
Issue tags: -issue in capctha module
Anybody’s picture

Status: Active » Closed (cannot reproduce)