We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36426
    • 197 Posts
    Hi any help would be really appreciated. I've set up Login, Register and Update Profile but I'm looking to get these working better together.

    For Register I have a couple of problems.

    1. Validation error messages have stop appearing and do not show...
    2. I have a drop down list with 3 options. I'd really like to have if two of these options require a tick box required to continue registration to confirm reading terms and conditions. But one option to just let a user register without needing to tick the box. To make this even more complicated I have two tick boxes so it could be either one depending which they choose to read!

    Here is my Register code if anyone can please help:

    [[!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, saverlenderdeveloper: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>
    <label for="saverlenderdeveloper">Please Select One</label><select id="saverlenderdeveloper" name="saverlenderdeveloper">
    <option value="Saver">Saver</option>
    <option value="Lender">Lender</option>
    <option value="Developer">Developer</option>
    </select>
    <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="sophisticatedinvestor" 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></div>


    My Login setup seems to work ok - but is there a way to set Register and Login to both use an email address instead of using Username? I tried adding &usernameField=`email` but couldn't seem to get it to work, it stopped my register form working at all...

    Here is my Login code too:

    [[!Login? &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &errTpl=`lgnErrTpl` &loginResourceId=`1` &logoutResourceId=`1`]]


    And now to UpdateProfile. This works pretty well, but I'd really like it to save which tick box was selected during Registration, at the moment it just shows them both unticked... Again I'd also like to customise this so it's just Email and no username if possible?

    <p>[[!UpdateProfile? &validate=`fullname:required,email:required:email`]]</p>
    <div class="update-profile">
    <div class="updprof-error">[[+error.message]]</div>
    [[+login.update_success:if=`[[+login.update_success]]`:is=`1`:then=`[[%login.profile_updated? &namespace=`login` &topic=`updateprofile`]]`]]</div>
    <div class="update-profile"><br class="updprof-error" /><form class="form" action="[[~[[*id]]]]" method="post"><input type="hidden" name="nospam" value="" />
    <p>Are you a Saver, Lender or Developer?</p>
    <label for="saverlenderdeveloper">Select or Update:</label>[[!+saverlenderdeveloper:is=`Saver`:then=`<select id="saverlenderdeveloper" name="saverlenderdeveloper">
    <option selected="selected" value="Saver">Saver</option>
    <option value="Lender">Lender</option>
    <option value="Developer">Developer</option>
    </select>`:else=``]] [[!+saverlenderdeveloper:is=`Lender`:then=`<select id="saverlenderdeveloper" name="saverlenderdeveloper">
    <option value="Saver">Saver</option>
    <option selected="selected" value="Lender">Lender</option>
    <option value="Developer">Developer</option>
    </select>`:else=``]] [[!+saverlenderdeveloper:is=`Developer`:then=`<select id="saverlenderdeveloper" name="saverlenderdeveloper">
    <option value="Saver">Saver</option>
    <option value="Lender">Lender</option>
    <option selected="selected" value="Developer">Developer</option>
    </select>`:else=``]]
    <p><strong>Savers & Lenders Only</strong></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="sophisticatedinvestor" value="[[+sophisticatedinvestor:default=` `]]" /> <input id="sophisticatedinvestor" class="checkbox" type="checkbox" name="sophisticatedinvestor" value="[[+sophisticatedinvestor:default=`Sophisticated Investor`]]" /> <label class="checkbox-label" for="sophisticatedinvestor-checkbox">I have signed the Self-Certified Sophisticated Investor Statement</label></li>
    </ul>
    <br /> <label for="fullname">[[!%login.fullname? &namespace=`login` &topic=`updateprofile`]] <span class="error">[[+error.fullname]]</span> </label> <input id="fullname" type="text" name="fullname" value="[[+fullname]]" /> <br /> <label for="email">[[!%login.email]] <span class="error">[[+error.email]]</span> </label> <input id="email" type="text" name="email" value="[[+email]]" /> <br /> <label for="phone">[[!%login.phone]] <span class="error">[[+error.phone]]</span> </label> <input id="phone" type="text" name="phone" value="[[+phone]]" /> <br /> <label for="mobilephone">[[!%login.mobilephone]] <span class="error">[[+error.mobilephone]]</span> </label> <input id="mobilephone" type="text" name="mobilephone" value="[[+mobilephone]]" /> <br /> <label for="fax">[[!%login.fax]] <span class="error">[[+error.fax]]</span> </label> <input id="fax" type="text" name="fax" value="[[+fax]]" /> <br /> <label for="address">[[!%login.address]] <span class="error">[[+error.address]]</span> </label> <input id="address" type="text" name="address" value="[[+address]]" /> <br /> <label for="country">[[!%login.country]] <span class="error">[[+error.country]]</span> </label> <input id="country" type="text" name="country" value="[[+country]]" /> <br /> <label for="city">[[!%login.city]] <span class="error">[[+error.city]]</span> </label> <input id="city" type="text" name="city" value="[[+city]]" /> <br /> <label for="state">[[!%login.state]] <span class="error">[[+error.state]]</span> </label> <input id="state" type="text" name="state" value="[[+state]]" /> <br /> <label for="zip">[[!%login.zip]] <span class="error">[[+error.zip]]</span> </label> <input id="zip" type="text" name="zip" value="[[+zip]]" /> <br /> <label for="website">[[!%login.website]] <span class="error">[[+error.website]]</span> </label> <input id="website" type="text" name="website" value="[[+website]]" /> <br /> <br class="clear" />
    <div class="form-buttons"><input type="submit" name="login-updprof-btn" value="[[!%login.update_profile]]" /></div>
    </form></div>
    


    Thanks again to anyone who can help improve any of these three parts. Any help at all would be really appreciated!
      Yorkshire UK based hosting provider: https://www.simulant.uk
      • 36426
      • 197 Posts
      Hi I'm happy to pay for these fixes as well as a few other improvements to the website if anyone can help? I've posted about paid work here:

      https://forums.modx.com/thread/89744/paid-work-for-anyone-who-can-fix-and-improve-my-register-login-and-update-profile-code#dis-post-493357
        Yorkshire UK based hosting provider: https://www.simulant.uk
        • 3109 ☆ A M B ☆
        • 894 Posts
        Jonahnaylor You only need to set the usernameField value on the register call not in the Login one.

        You also have a syntax error on your Register call after your customValidators parameter thats probably why your registration form is broken.

        So your registration call should look like this:

        [[!Register? &usernameField=`email` &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, saverlenderdeveloper:required, email:required:email` &placeholderPrefix=`reg.`  ]]
        


        As for displaying the terms and conditions I would use some js to display them if both checkboxes are checked.

        Finally in order to save those values for each user you need to use extended user fields and use the values of the checkboxes as the value of the extended user fields.

        Hopefully that gets you on the right track, good luck.
          Benjamin Marte
          Interactive Media Developer
          Follow Me on Twitter | Visit my site | Learn MODX
          • 36426
          • 197 Posts
          Quote from: benmarte at Mar 23, 2014, 08:45 AM
          Jonahnaylor You only need to set the usernameField value on the register call not in the Login one.

          You also have a syntax error on your Register call after your customValidators parameter thats probably why your registration form is broken.

          So your registration call should look like this:

          [[!Register? &usernameField=`email` &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, saverlenderdeveloper:required, email:required:email` &placeholderPrefix=`reg.`  ]]
          


          As for displaying the terms and conditions I would use some js to display them if both checkboxes are checked.

          Finally in order to save those values for each user you need to use extended user fields and use the values of the checkboxes as the value of the extended user fields.

          Hopefully that gets you on the right track, good luck.

          Hi thanks very much, that's fixed up most of my issues! Much appreciated.
            Yorkshire UK based hosting provider: https://www.simulant.uk