Stop the Username field of the DNN login control focusing
We've just finished another DNN website, www.alliedinsurancegroup.co.nz. The website has an account login module on the homepage. By default, the Username field of this module takes the focus on page load. This was a problem for this sites homepage since the account login module was quite low down on the page.
When the page was loading, the username field was taking focus, and hence the page was scrolling to the bottom. Not a good look! Here's how I quickly fixed this issue; I simply added this to the bottom of my Skin ascx file for this site - thanks to Keith for the update (mentioned in comments section):
<script language="javascript" type="text/javascript">
window.onload = document.location='#';
</script>
I guess you could add this code to a text/html module, but didn't really want a similar thing happening on other pages either.
Hope this helps someone else.
Cheers,
Tim,