'remove', 'selector' => 'fieldset.captcha', 'value' => NULL ); //$data['debug'] .= 'C'; } // ALways Show else { //$data['debug'] .= 'D'; // MATH if ($form_state['values']['captcha_type'] === 'math') { $selector = "#edit-captcha-response-wrapper .field-prefix"; $type = 'html_in'; //$data['debug'] .= 'E'; } elseif ($form_state['values']['captcha_type'] === 'text') { $selector = "#edit-captcha-response-wrapper label[for='edit-captcha-response']"; $type = 'html_in'; //$data['debug'] .= 'F'; } elseif ($form_state['values']['captcha_type'] === 'image') { $selector = ".captcha img"; $type = 'html_out'; //$data['debug'] .= 'G'; } $data['updaters'][] = array( 'type' => 'field', 'selector' => '#edit-captcha-token', 'value' => $form_state['values']['captcha_token'] ); $data['updaters'][] = array( 'type' => $type, 'selector' => $selector, 'value' => $form_state['values']['captcha_query'] ); $data['updaters'][] = array( 'type' => 'field', 'selector' => '#edit-captcha-response', 'value' => '' ); captcha_pre_render($form); } } return TRUE; }