Drupal 7 - 通过Ajax提交user_profile_form

时间:2014-02-21 15:23:31

标签: ajax drupal user-profile

我正在尝试在页面中包含user_profile_form,并希望使用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'
    );
  }  
}

它适用于登录表单,但不适用于user_profile_form,我的回调实际上从未被调用过。当我提交表单时,我从system / ajax中得到错误500 ...

如何通过ajax处理用户个人资料?

0 个答案:

没有答案