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
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityYou 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.