if a user tries to register with a username or email that is already in use, there is no feedback telling them this, it just highlights the form field red, this is quite a bad UX.

How can I add translatable text to the effect of "that email is already in use, have you forgotten your password?" ?

I would really like to do this without adding a module.

Here you can see there is validation feedback, but it's not relevant, as my username meets its criteria, it should highlight the duplicate account problem. The user would just get frustrated at this point as they are told to do something which makes no difference.

enter image description here

  • Core does that by default, there must be something on your site preventing the message from showing.
    – Andy
    Jul 30 '14 at 12:46
  • Thanks andy, yes I've been trying to customise the form and maybe messed something up. I've updated my question accordingly
    – S..
    Jul 30 '14 at 12:49
  • Ah, I think maybe it would make sense ask a new Q about your overall goal? (In short, you shouldn't use the theme layer to alter behaviour, it's for modifying markup. You can use hook_form_FORM_ID_alter() to modify specific existing forms.)
    – Andy
    Jul 30 '14 at 13:02
  • Thanks I'll look into that hook. I previously had this question: drupal.stackexchange.com/questions/125057/… which covered most of what I want, but just got voted down and told to use modules which didn't work for me.
    – S..
    Jul 30 '14 at 13:17
  • Given that you'll only accept a custom solution, I suspect you won't get much traction on that Q until you've posted an attempt. In my experience typically folk here are happy to point you in the right direction, but less likely to just write your code for you (but will help debugging). If you search for drupal modifying forms or around that function I mentioned you should get lots of hits. Also if there are modules you won't use but that already do what you want, crack 'em open and look inside (:
    – Andy
    Jul 30 '14 at 13:28

It sounds like your theme is missing from the page template, which will usually show a description of the error at the top of the page.

I know you said no modules but I would recommend looking at Username originality AJAX check which is very small and does an ajax lookup before the form is submitted.

  • 32 open issues, 11 open bugs, no recommended release for version 7, now you see why I'm cautious of modules :) I installed and tested, works for me so will use. Thanks. I also used drupal.org/project/email_registration to remove the username field, better UX in my opinion.
    – S..
    Jul 30 '14 at 14:22

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.