We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7045
    • 225 Posts
    I will give more details when I have a chance, but I am hoping someone might have a quick fix.

    I have a login form on a site, no registration, no forgot password, etc. This will just be used by the client. Only in Firefox, and not every time, when I hit submit it redirects me to the "thank you" page I have set for a formit email form. I then receive an email in the email account I use for testing formit, with all blank fields.

    The formit email form won’t even send without filling out all the fields. This is very odd, but I have a feeling it is something minor. Any help is much appreciated.


      • 3749
      • 24,544 Posts
      Check the "action" of the form on the Login page. Also check the ID of the redirect parameter in the Login snippet tag (can’t remember what it’s called).
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 7045
        • 225 Posts
        I know the ID is correct, but let me check the "action". That sounds like something I would overlook. Thanks Bob.
          • 7045
          • 225 Posts
          Ok, I have an update. The login form is in a side bar column, to the right of every page. This behavior only happens when I am on the page that contains the formit contact form. So when this behavior is occurring, I have one instance of formit and one instance of login on the same page.

          Nothing I try helps. I still get an email sent when I login while on the contact page.
            • 3749
            • 24,544 Posts
            Look at the page source and make sure that the two sets of <form> </form> tags don’t overlap and that each has its own submit button within the tags.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 7045
              • 225 Posts
              Ok, looking at the source code has shown me what is the problem (I think), but I have no idea how to fix it. I know it is something simple, but I can’t find an answer.

              <form action="[[~[[*id]]]]" method="post">
              


              That is the action that I have for the login form and the contact form. Like I mentioned, the login form is on a right-side column. I am using a custom login tpl, but it is almost the same as the default.

              I obviously can’t have this for both the login and contact form, while they are on the same page. What can I use for action that won’t conflict with the contact form action?
                • 3749
                • 24,544 Posts
                It’s not the action you want to change. Both snippets want to repost to the current page in order to complete their work. You could have them forward the user somewhere else and put a second copy of the snippet there, but I don’t think you have to.

                Look at the hidden form field value that each snippet uses to detect a repost -- make sure they are different.

                Also, add a name attribute to each form:

                <form name = "login" action=">
                </form>


                In theory, that should separate their actions and submitting from one form shouldn’t affect the other form.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 7045
                  • 225 Posts
                  I am about to give up. I know I am doing something stupid, but I just can’t see it. I gave both forms unique names, and it didn’t help. Then I decided to remove the hidden field from the login form, just to see what would happen. It is as follows, and it is the same as for the default login form.

                  <input type="hidden" name="service" value="login" />
                  


                  On non-contact form pages, nothing happens (as expected). However, on the contact form page, it still sends the contact form.
                    • 7045
                    • 225 Posts
                    I just rechecked my login form, to see if that form was the issue. This is what I have for the hidden field:

                    <input type="hidden" name="nospam:blank" value="" />
                    


                    I just copied from the example, assuming it was correct. Maybe that is the problem.

                    Forgive me for all this, as I am still getting use to revo.
                      • 3749
                      • 24,544 Posts
                      Those things aren’t used to test for a repost, so you should put them back the way they were.

                      FormIt checks for a repost with this code:

                      if (!empty($submitVar) && empty($_POST[$submitVar])) return '';


                      If you don’t send a &submitVar parameter in the snippet tag, it will fall through and execute its hooks (e.g., email) when the Login repost occurs (and the submitVar is not there). Note that to make FormIt work, then, you need to make sure you have a matching hidden submitVar in the FormIt form.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting