I am trying to include the user_profile_form in a page, and want it to be handled using AJAX.
function wr_pages_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'user_login_block' || $form_id == 'user_login') {
$form['actions']['submit']['#ajax'] = array( //WORKING
'callback' => 'wr_login_form_callback',
'wrapper' => 'user-login',
'method' => 'replace',
'effect' => 'fade'
);
}
if ($form_id == 'user_profile_form') { //NOT WORKING
$form['actions']['submit']['#ajax'] = array(
'callback' => 'wr_profile_form_callback',
'wrapper' => 'wr-user-profile-form',
'method' => 'replace',
'effect' => 'fade'
);
}
}
It is working for the login form, but not for the user_profile_form, my callback is actually never called. When I submit the form I get an error 500 from system/ajax...
How can I process the user profile via ajax?