We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23510
    • 168 Posts
    I’m using the latest - 1.54. I originally tried using

    &emailField=`username`

    and this did not work and it worked fine with the snippet.
      • 23510
      • 168 Posts
      Correction - it needs the &emailField=`username` line...that is to send out the activation email, however, the email address was not getting saved in the user table, and that’s what the snippet does.

      Note that I just have an Email field, and the two password fields and I wanted the user to use their email as the username.
        • 17016
        • 138 Posts
        Quote from: splittingred at Sep 20, 2010, 12:48 PM

        What are you trying to do here, just set the username for the new user as the email?

        If so, you can use the &usernameField=`email` property to do that.

        Thanks. This works very fine on our system
          • 36426
          • 197 Posts
          Hi I hope someone can help.

          I've set up Login and Register and the update profile page etc, but I also want to use the email as the username.

          Can anyone please let me know what to change in my snippets and also advise if this now works (as the thread is pretty old) or if I have to add a pre-hook also?

          Thanks for any help. I have tried adding &usernameField=`email` to my Register call but it then won't let me register on testing. Also how does this affect the Profile page and updating your profile?

          Thanks again for any support.
            Yorkshire UK based hosting provider: https://www.simulant.uk
            • 36426
            • 197 Posts
            Quote from: Letti at Mar 23, 2011, 09:46 AM
            Quote from: splittingred at Sep 20, 2010, 12:48 PM

            What are you trying to do here, just set the username for the new user as the email?

            If so, you can use the &usernameField=`email` property to do that.

            Thanks. This works very fine on our system

            Here is my snippet call and form:

            [[!Register? &usergroupsField=`saver,lender,developer` &submitVar=`registerbtn` &activationResourceId=`11` &activationEmailTpl=`myActivationEmailTpl` &activationEmailSubject=`Thanks for Registering!` &submittedResourceId=`10` &customValidators=`customvalidators`; &validate=`nospam:blank, username:required:minLength=^6^, password:required:minLength=^6^, password_confirm:password_confirm=^password^, fullname:required, email:required:email` &placeholderPrefix=`reg.` ]]
            <div class="register">
            <div class="registerMessage">[[!+reg.error.message]]</div>
            <form class="form" action="[[~[[*id]]]]" method="post"><fieldset><legend class="registerLegend">Register</legend> <input type="hidden" name="nospam" value="[[!+reg.nospam]]" /> <label for="username"><label for="username">[[%register.username? &namespace=`login` &topic=`register`]]</label></label> <span class="error">[[!+reg.error.username]]</span> <input id="username" type="text" name="username" value="[[!+reg.username]]" />
            <p> </p>
            <label for="fullname">[[%register.fullname]] <span class="error">[[!+reg.error.fullname]]</span> </label> <input id="fullname" type="text" name="fullname" value="[[!+reg.fullname]]" />
            <p> </p>
            <label for="email">[[%register.email]] <span class="error">[[!+reg.error.email]]</span> </label> <input id="email" type="text" name="email" value="[[!+reg.email]]" />
            <p> </p>
            <label for="password">[[%register.password]] <span class="error">[[!+reg.error.password]]</span> </label> <input id="password" type="password" name="password" value="[[!+reg.password]]" />
            <p> </p>
            <label for="password_confirm">[[%register.password_confirm]] <span class="error">[[!+reg.error.password_confirm]]</span> </label> <input id="password_confirm" type="password" name="password_confirm" value="[[!+reg.password_confirm]]" />
            <p> </p>
            <p>Are you a Saver, Lender or Developer?</p>
            <ul style="list-style: none;">
            <li><input type="hidden" name="saver" value="[[+saver:default=``]]" /> <input id="saver" class="checkbox" type="checkbox" name="saver" value="[[+saver:default=`Saver`]]" /> <label class="checkbox-label" for="saver-checkbox">Saver</label></li>
            <li><input type="hidden" name="lender" value="[[+lender:default=``]]" /> <input id="lender" class="checkbox" type="checkbox" name="lender" value="[[+lender:default=`Lender`]]" /> <label class="checkbox-label" for="lender-checkbox">Lender</label></li>
            <li><input type="hidden" name="developer" value="[[+developer:default=``]]" /> <input id="developer" class="checkbox" type="checkbox" name="developer" value="[[+developer:default=`Developer`]]" /> <label class="checkbox-label" for="developer-checkbox">Developer</label></li>
            </ul>
            <p><strong>Savers & Lenders Only:</strong> Please confirm one of the following: *</p>
            <ul style="list-style: none;">
            <li><input type="hidden" name="highnetworth" value="[[+highnetworth:default=``]]" /> <input id="highnetworth" class="checkbox" type="checkbox" name="highnetworth" value="[[+highnetworth:default=`High Net Worth`]]" /> <label class="checkbox-label" for="highnetworth-checkbox">I have signed the Self-Certified High Net Worth Individual Statement</label></li>
            <li><input type="hidden" name="sofphisticatedinvestor" value="[[+sophisticatedinvestor:default=``]]" /> <input id="sophisticatedinvestor" class="checkbox" type="checkbox" name="sophisticatedinvestor" value="[[+lender:default=`Sophisticated Investor`]]" /> <label class="checkbox-label" for="sophisticatedinvestor-checkbox">I have signed the Self-Certified Sophisticated Investor Statement</label></li>
            </ul>
            <p> </p>
            <br class="clear" />
            <div class="form-buttons"><input type="submit" name="registerbtn" value="Register" /></div>
            </fieldset></form>


            Does anyone know how I adjust this to use &usernameField=`email` please? Thanks for any help.
              Yorkshire UK based hosting provider: https://www.simulant.uk