We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I’m using the WebSignup snippet on http://thevirtualhandshake.com/directory.htm -- click on one of the company profiles and you’ll notice that when you get there, the screen scrolls down to the web registration form automatically, which is at the bottom of the page. I don’t want this behavior, but I can’t figure out why it is happening when the page loads?? Anyone know how to stop this?
      • 24253
      • 125 Posts
      I think it’s this piece of code causing that behaviour:

      if (document.loginfrm) document.loginfrm.username.focus();

      You’ll find it here:

      assets\snippets\weblogin\weblogin.inc.php

      Search for:

      	<script type="text/javascript">
      		if (document.loginfrm) <?php echo !empty($uid) ? "document.loginfrm.password.focus()" : "document.loginfrm.username.focus()" ?>;
      	</script>
      


      I guess removal of that code will give you the wanted behaviour.

      But I’m not completely sure though...

      Best,

      Remon
      • Yeah, that looked like the culprit, but commenting it out still exhibits the same behavior. Thanks for the help though -- any other ideas? I guess perhaps it could be something with the webLoginEnter() function, but that shouldn’t be getting called...I don’t believe... huh
        • Quote from: OpenGeek at Jun 09, 2005, 05:09 PM

          Yeah, that looked like the culprit, but commenting it out still exhibits the same behavior. Thanks for the help though -- any other ideas? I guess perhaps it could be something with the webLoginEnter() function, but that shouldn’t be getting called...I don’t believe... huh

          There were actually several other instances of this I found and removed -- finally getting rid of this behavior. I’m going to look into how we can isolate such scripting behavior to individual login and signup form templates (e.g. chunks).

          Thanks for everyone who helped me out wink
            • 30884
            • 142 Posts
            Sorry to raise this thread from the dead but the install of Modx I’ve just picked up (0.95) is presenting me with this focus on weblogin and not the websignup pages. I’ve looked at the weblogin.inc.php and it’s dated 2004 and is version 1.0.

            Is there an updated version/snippet I can use?

            I’m a little wary about removing some of the routines until they break but I’ll give it a go and see if I can resolve this here.
            Cheers

            TXRX
              p i x e l p u s h e r e x t r o d i n a i r e
              A x i s A n i m a t i o n . c o m
            • There’s no update and it honestly has not been looked at in a long time. If you clean some stuff up, though, there’s a good chance that it’ll make it into the next release. smiley
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 30884
                • 142 Posts
                This is more interestingly weird than I thought. Seems that InternetExplorer (6) doesn’t have this problem! Seems it’s a firefox 2.0 problem. This is maybe making me think that the problem may lie in the actual CSS and it’s sample site template.

                I’m about to try a fresh install in another server here and I’ll create something that consists of these elements in the most basic of CSS templates (in a bid to get my CSS working as intended) and see if this problem still persists. I’ve tried hacking out all the source with ’focus’ and foreground parameters and it just changed certain behaviours but not to the extent I’m aiming for. I’ll let y’all know how I get on.

                Just wanted to point out the IE6 & Firefox 2.0 difference on this topic.
                Cheers

                TXRX
                  p i x e l p u s h e r e x t r o d i n a i r e
                  A x i s A n i m a t i o n . c o m
                • Try validating your HTML and CSS. I’ve seen weird discrepancies between all browsers with "broken" html. It could also be a Fx extension I suppose, too.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 18878
                    • 210 Posts
                    Hello,

                    Sorry again for resurrecting this topic, but I’m having the same focus problem with Weblogin and IE, Firefox 2.0, Opera, etc. The header section of my page is very long, and everytime you load the page, the screen automatically scrolls down to the web login form located on a sidebar.

                    Does anyone know where are the lines that should be commented?

                    Thanks a lot.

                    Mc


                    • Line 89 of /assets/snippets/weblogin/weblogin.inc.php
                          <script type="text/javascript">
                              if (document.loginfrm) <?php echo !empty($uid) ? "document.loginfrm.password.focus()" : "document.loginfrm.username.focus()" ?>;
                          </script>
                      
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org