Hi,

If I use the #ajax property on a textfield it work well.
If I use a field with '#type' => 'password_confirm' it work well.

If I use both in the same form, when the ajax callback is trigerred, this is the answer : "Cannot create reference from/to string offset"

To test :
function form_builder() {
$form['ajaxfield'] = array(
'#type' => 'textfield',
'#title' => t('Enter anything'),
'#description' => t('Only lowercase alphanumeric characters and dash are allowed'),
'#ajax' => array(
'callback' => 'ajax_test_callback',
'wrapper' => 'test-result',
'method' => 'replace',
'effect' => 'fade',
),
);

$form['test-result'] = array(
'#type' => 'textfield',
'#title' => t('Test result'),
'#value' => '',
'#disabled' => TRUE,
'#prefix' => '

',
'#suffix' => '

',
'#weight' => -09,
);

$form['credential_password'] = array(
'#type' => 'password_confirm',
'#required' => TRUE,
'#size' => 25,
'#weight' => 0,
);

return $form;
}

function ajax_test_callback($form, $form_state){
return $form['test-result'];
}

Comments

segfaultmaker’s picture

Version: 7.0-beta1 » 7.x-dev

Confirmed on dev branch.