Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Widgets /

Discuss SilverStripe Widgets.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Login widget auto focus on email field, help!

Go to End

3 Posts   2099 Views


Community Member, 12 Posts

1 May 2010 at 7:40am

I implemented a login widget on this site I'm working on and I noticed that if the login widget is below the fold, when the page loads it automatically scrolls down the page so the email field can be visible. It's quite annoying, it seems that some javascript is getting added to the bottom of the page, but I can't seem to find where its coming from. I've. Looked through tons of files to see where its getting added in, but no luck. Need help please.


Forum Moderator, 5523 Posts

1 May 2010 at 9:48pm

This focus is probably coming from MemberLoginForm.php. Has something like

	(function() {
	var el = document.getElementById("MemberLoginForm_LoginForm_Email");
	if(el && el.focus) el.focus(); 

Which looks like it would focus it. Only way to disable that it looks like is setting the javascript validation handler to none.


Community Member, 12 Posts

2 May 2010 at 7:20am

OMG, they really hid that, I've been looking for that file FOREVER!
I had to do a search of entire local site in dreamweaver. Its in sapphire/security/MemberLoginForm.php
I can just comment that out, right?

Thanks Man!
REally Appreciate it.