We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3435
    • 37 Posts
    I’ve just handed over a draft website for users to input some content into, but whenever we view the site, it doesn’t display the page from the top, but defaults to the start of the main content area instead.

    I guess this could be a problem with my html or css rather than a MODx issue, but does anyone have any ideas?

    The site is http://dawlishswimmingclub.co.uk

    I think it may be related to the login area on the left hand side. The cursor defaults to being in the username box, so the screen is being scrolled down to make that field visible - can I stop this happening?
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      The javascript to focus on the login box seems to be the problem indeed.

      This piece of js is causing it:
      <script type="text/javascript">
              if (document.loginfrm) document.loginfrm.username.focus();
          </script>


      In the source code it shows right under the loginreminder form, might be worth checking out your form chunks.

      If you didn’t use a chunk for the form, find the default one, probably in /assets/snippets/snippetname somewhere, depending on the snippet you use.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 3435
        • 37 Posts
        Thank you for pointing me in the right direction - I had no idea where to start.

        The offending code is in /assets/snippets/weblogin/weblogin.inc.php

        Many thanks
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Just be careful when editing snippets directly wink

          You could also copy the default forms into a chunk and call the chunk instead. That’s actually recommended to do.
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.