General developer forum

Custom "two-step" login on Moodle 2.7

Picture of Michael Milette
Re: Custom "two-step" login on Moodle 2.7
Core developersParticularly helpful MoodlersPlugin developers

Hi Rosa,

Ever notice that terrible ideas can sometimes be seeds for the best ones? Consider this...

What if you just used a little CSS and JavaScript convert the existing Moodle login form into two overlaying DIV panels, one for password and one for password? A little JavaScript code could be used to add a Next button to the first panel and Back button to the second in addition to the existing login button. The Next button would simply hide it's own top  "username" panel, revealing the underlying one and the Back button would make the top one re-appear.

If I am right, I believe that a big advantage of this approach might be that password managers would still be able to fill in the fields in the form... and you could do it without modifying Moodle core at all.

Whether I have accessibility issues or not, it is really convenient to use a password manager to fill a form for you at the click of a button or the swipe of a finger print. I don't think this would be possible if you had a page re-load in between the two.

I haven't actually though this all the way through or tested it. It's just an idea I've been toying with lately because I find it a pain to have to use a password manager twice to login once. And, if the client doesn't support JavaScript (who turns it off anymore these days?), the original unmodified form would simply appear.

Let us know how your project works out or if you just want to do some brainstorming.

Best regards,


Average of ratings: Useful (1)