0

I'm writing a custom function to now allow spaces and other special characters for the username on the registration form.

How can I remove the text "Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores." on that page?

2

I figured it out:

function mymodule_form_user_register_form_alter(&$form, $form_state, $form_id) {

  if (!($form_id == 'user_register_form')) {
        return;
  }

  $form['account']['name']['#description'] = 'Username has to be between 5-20 characters long and can only contain letters and numbers.';
}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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