Commit e1719e94 authored by Stefaan Lippens's avatar Stefaan Lippens Committed by Stefaan Lippens
Browse files

ajax replace the captcha element and not a sub element

parent c5244460
......@@ -215,33 +215,24 @@ function captcha_process($element, $edit, &$form_state, $complete_form) {
'#type' => 'hidden',
'#value' => $captcha_sid,
);
$element['captcha_sid_debug'] = array(
'#type' => 'item',
'#title' => 'CAPTCHA sid',
'#value' => $captcha_sid,
);
$element['captcha_request_new_challenge'] = array(
'#type' => 'submit',
'#value' => t('New challenge'),
'#submit' => array('poll_more_choices_submit'), // If no javascript action.
'#ahah' => array(
'path' => 'captcha/ajax/' . $captcha_sid,
'wrapper' => 'captcha-foo',
'wrapper' => 'captcha-request-new-challenge-wrapper',
'method' => 'replace',
'effect' => 'fade',
),
);
$element['captcha_foo'] = array(
'#type' => 'markup',
'#title' => t('CAPTCHA foo'),
'#value' => 'CAPTCHA foo',
'#prefix' => '<div id="captcha-foo">',
'#suffix' => '</div>',
'#attributes' => array('id' => 'captcha_foo'),
);
$element['#prefix'] = '<div id="captcha-request-new-challenge-wrapper">';
$element['#suffix'] = '</div>';
// Additional one time CAPTCHA token: store in database and send with form.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment