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


    I'm trying to use login.register with extended field on user profile.
    Seams to works ok (except no validation email is sent)
    but, first, I'm , puzzled whent I try to organize those ext.fields into contaniers
    (building our online shop with Simple cart and need to add a lot of new data into each user profile when they'll self register)
    My goal would be to get a series of data under ORDERS
    (fname,lname,addr1 and 2, zip, country, etc..)
    and pretty the same under a DELIVERY container

    But how to use register to deal with containers' creation ?
    I saw somewhere a sample with input named like this : name="CONTAINER[fieldname]"

    I' tried a few variations of this example but not sure at all it's ok, and this way may frontend inputs are showing the trailing "]" meaning ther's aomething wrong..

    <label class=" control-label sr-only" for="ORDERS[order_lastname]">[[%register.lastname]]                                                                                                        
                <span class="error">[[!+reg.error.ORDERS[order_lastname]]]                                                                                           
                </span>                                                                                     
              </label>                                                        
              <div class=" input-group">                                      
                <span class="input-group-addon">                                            
                  <i class="oi oi-people"></i>                                      
                </span>                                                                                                      
                <input class="form-control"  type="text" name="ORDERS[order_lastname]:required" id="order_lastname" value="[[!+reg.ORDERS[order_lastname]]]" placeholder="Last name"/>                                             
              </div>


    Thank you
      • 36604
      • 268 Posts
      Edit

      Seams to works but deeply linked with the way the Register call is written.

      so now I have this issue:

      call
      [[!Register?
      &submitVar=`registerbtn`
      &activation=`1`
      &activationEmailTpl=`lgnActivateEmailTpl`
      &activationEmailSubject=`Please activate your account!`
      &activationResourceId=`54`
      &submittedResourceId=`53`
      &useExtended=`1`
      &emailField=`order_email`
      
      &usergroups=`Members`
      &validate=`nospam:blank,
        username:required:minLength=^6^,
        password:required:minLength=^6^,
        password_confirm:password_confirm=^password^,
        ORDERS[order_firstname]:required
      `
      &placeholderPrefix=`reg.`
      ]]
      


      with ORDERS[order_firstname]:required inside the call or simple order_firstname:required

      The profil got 2 new fields for firstname instead of 1
      one correctly categorized under ORDERS container
      + another at the 'root' or the ext.fields.

      In the form I added a space after the closingbracket of ORDERS[field_name] :
       <div class="form-group ">                                                                                       
                <label class=" control-label sr-only" for="ORDERS[order_firstname]">[[%register.fname]]                                                                                                        
                  <span class="error">[[!+reg.error.ORDERS[order_firstname] ]]                                                                                           
                  </span>                                                                                     
                </label>                                                        
                <div class=" input-group">                                      
                  <span class="input-group-addon">                                            
                    <i class="oi oi-people"></i>                                      
                  </span>                                                                                                      
                  <input class="form-control"  type="text" name="ORDERS[order_firstname]:required" id="order_firstname" value="[[!+reg.ORDERS[order_firstname] ]]" placeholder="[[%register.fname]]"/>                                             
                </div>
        • 46886
        • 1,154 Posts
        I think you may have a situation where your extended field has the same name as a normal field. Is the data in both the same? I would say try to give that extended field a unique name and then the problem may be gone...
          • 36604
          • 268 Posts
          Quote from: nuan88 at Jan 20, 2015, 04:21 PM
          I think you may have a situation where your extended field has the same name as a normal field. Is the data in both the same? I would say try to give that extended field a unique name and then the problem may be gone...

          hmm.
          No. there's no "firstname" standard field name in modx, and not at all "order_firstname"

          Seams like the &validate is causing the issue because if Iuse:
          &validate=`nospam:blank,
            username:required:minLength=^6^,
            password:required:minLength=^6^,
            password_confirm:password_confirm=^password^,
          `

          With no control over ext fields the isuue is gone (only one correct version of the desired ext.fields (ORDERS[order_firstname]) in my test.

          BUT if I use a validation over an ext.fields:
          &validate=`nospam:blank,
            username:required:minLength=^6^,
            password:required:minLength=^6^,
            password_confirm:password_confirm=^password^,
          ORDERS[order_firstname]:required`
          or whatever else (:minLength=^2^ for instance) over the ext.field, then
          pseudo doublon appears (with no value in the 'root' of ext fields, and correct in the container).