2

I am trying to remove the text "please wait" that happen on every Drupal Ajax call. Could anyways one point me the way to achieve this in an elegant manner (without any module or CSS hack)?

Thanks

1 Answer 1

5

You should be able to do this with hook_form_alter() by changing the Ajax settings that control the form's Ajax. There is a 'progress' property in Ajax that will allow you to set or change the 'Please wait...' text. From the API docs:

#ajax['progress']['message'] String. An optional message to the user; should be wrapped with t().

A sample hook_form_alter() that will accomplish this:

function mymodule_form_FORM_ID_alter($form, &$form_state) {
  unset($form['element']['#ajax']['progress']['message']);
  // or:
  $form['element']['#ajax']['progress']['message'] = '';
}

You should be able to use print_r($form); or dsm($form) (with Devel module) to locate the form element with Ajax properties set. Use that to locate the proper element and replace my $form['element'] above with the actual element in question.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.