Drupal 7-通过Ajax提交用户配置文件表单
我试图在页面中包含用户配置文件表单,并希望使用AJAX处理它Drupal 7-通过Ajax提交用户配置文件表单,ajax,drupal,user-profile,Ajax,Drupal,User Profile,我试图在页面中包含用户配置文件表单,并希望使用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' =>
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'
);
}
}
它适用于登录表单,但不适用于用户配置文件表单,我的回调实际上从未被调用。当我提交表单时,我从system/ajax中得到一个错误500
如何通过ajax处理用户配置文件?可能重复