We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36435
    • 40 Posts
    Hi guys.

    I'm running modx ver. 2.4.2 and I'm trying to get the Login Extra to work. I'm following along with the tutorial here - https://rtfm.modx.com/extras/revo/login/login.tutorials/login.request-membership (I've already done the Basics Setup)

    The problem I'm running into is that after submitting the registration form, I'm not getting any redirect (the same page reloads) no user is created and no registration email is sent.

    I've all the pages and confirmed that I'm using the correct id's in the snippet.

    Here's the registration form:

    [[!Register?
        &submitVar=`registerbtn`
        &activationResourceId=`297`
        &activationEmailTpl=`lgnActivateEmailTpl`
        &activationEmailSubject=`Thanks for Registering!`
        &submittedResourceId=`296`
        &usergroups=`Members`
    ]]
     
    
    <div class="logreg-content">
        <div class="register-content">
            <div class="registerMessage">[[+error.message]]</div>
              
            <form class="form" action="[[~[[*id]]]]" method="post">
                <input type="hidden" name="nospam:blank" value="" />
                  
                <label for="username">[[%register.username? &namespace=`login` &topic=`register`]] <span>*</span>
                    <span class="error">[[+error.username]]</span>
                </label>
                <input type="text" name="username:required:minLength=6" id="username" value="[[+username]]" />
                  
                <label for="password">[[%register.password]] <span>*</span>
                    <span class="error">[[+error.password]]</span>
                </label>
                <input type="password" name="password:required:minLength=6" id="password" value="[[+password]]" />
                  
                <label for="password_confirm">[[%register.password_confirm]] <span>*</span>
                    <span class="error">[[+error.password_confirm]]</span>
                </label>
                <input type="password" name="password_confirm:password_confirm=`password`" id="password_confirm" value="[[+password_confirm]]" />
                  
                <label for="fullname">[[%register.fullname]] <span>*</span>
                    <span class="error">[[+error.fullname]]</span>
                </label>
                <input type="text" name="fullname:required" id="fullname" value="[[+fullname]]" />
                  
                <label for="email">[[%register.email]] <span>*</span>
                    <span class="error">[[+error.email]]</span>
                </label>
                <input type="text" name="email:email" id="email" value="[[+email]]" />
            
                <button type="submit" name="registerbtn">Register</button>
              
            </form>
        </div>
    </div>
    


    Any ideas as to what I could have missed?

    This question has been answered by multiple community members. See the first response.

    • discuss.answer
      I don't see anything, but my eyes aren't so good any more and I miss a lot of stuff. Here is a registration form I'm using with success - I'm using Javascript to make the fullname the same as the username, but other than that it works as normal. It should give you something to compare against. If yours still isn't working, install the QuickEmail snippet and makes sure email is working from your server. http://bobsguides.com/quickemail-snippet-tutorial.html

      [[!Register?
        &submitVar=`registerbtn`
        &activationResourceId=`69`
        &activationEmailTpl=`lgnActivateEmailTpl`
        &activationEmailSubject=`Thanks for Registering!`
        &submittedResourceId=`68`
        &usergroups=`Members`
      ]]
       
      <div class="register">
        <div class="registerMessage">[[+error.message]]</div>
            
        <form class="form" action="[[~[[*id]]]]" method="post">
          <input type="hidden" name="nospam:blank" value="">
          <input type="hidden" name="fullname" id="fullname" value="">
      
          <label for="username">[[%register.username? &namespace=`login` &topic=`register`]]
            <span class="error">[[+error.username]]</span>
          </label>
          <input class="form-control" type="text" name="username:required:minLength=6" id="username" value="[[+username]]">
      
          <label for="password">[[%register.password]]
            <span class="error">[[+error.password]]</span>
          </label>
          <input class="form-control" type="password" name="password:required:minLength=6" id="password" value="">
      
          <label for="password_confirm">[[%register.password_confirm]]
            <span class="error">[[+error.password_confirm]]</span>
          </label>
          <input class="form-control" type="password" name="password_confirm:password_confirm=`password`" id="password_confirm" value="">
      
          <label for="email">[[%register.email]]
            <span class="error">[[+error.email]]</span>
          </label>
          <input class="form-control" type="text" name="email:email" id="email" value="[[+email]]">
      
          <div class="form-buttons">
            <input class="btn btn-default" type="submit" name="registerbtn" value="Register">
          </div>
        </form>
      </div>
      
        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
        • 3749
        • 24,544 Posts
        Do you see any relevant errors in the MODX error log?
          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
        • discuss.answer
          • 36435
          • 40 Posts
          Thanks Susan.

          It's working now - strange thing - it seems the form didn't like my using a button. I had my submit button as

          <button type="submit" name="registerbtn">Register</button>


          when I switched it back to

          <input type="submit" name="registerbtn" value="Register" />


          Does that mean we should avoid <button> in the registration forms? It's no big deal, obviously - I'll just edit my css. but it would be good to know.

          Thanks for the responses!
            • 30585
            • 833 Posts
            Some frontend form validators highjack submit input fields to prevent default behaviors. This results in an endless page reload if the $_POST['registerbtn'] variable is not set after the form is validated. Passing the submitVar in a hidden input field is more reliable.
                <input type="hidden" name="registerbtn" value="Register">
            
                // use a regular button to submit the form when dealing with frontend form validators
                <button id="submitBtn" type="submit">Register</button>
            
              A MODx Fanatic