2

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?

sebastian
  • 16,470
  • 1
  • 22
  • 18
  • 1
    Possible duplicate of [Drupal AJAX button on user profile](http://stackoverflow.com/questions/20873612/drupal-ajax-button-on-user-profile) – tanius Jul 15 '16 at 10:33

0 Answers0