<![CDATA[ Register & validate over extended fields blocks submit ? - My Forums]]> https://forums.modx.com/thread/?thread=96001 <![CDATA[Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit?page=2#dis-post-519555
If I validate over any extended fields, then the submit gives back the form page again (but no error place holders appears)
&validate=`nospam:blank,
  username:required:minLength=^6^,
  password:required:minLength=^6^,
  password_confirm:password_confirm=^password^,
  order_fname:minLength=^2^
`


but if I do not validate over an ext field, then everything is ok , all fields (incl. ext fields) are actually created on user's profile.

Thank you]]>
elz064 Jan 30, 2015, 09:15 AM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit?page=2#dis-post-519555
<![CDATA[Re: Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-521210
http://forums.modx.com/thread/44901/add-extended-fields-to-multiple-existing-user-accounts#dis-post-520754]]>
nuan88 Feb 24, 2015, 01:53 AM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-521210
<![CDATA[Re: Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519899 nuan88 Feb 04, 2015, 12:05 AM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519899 <![CDATA[Re: Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519871
In addition, this is not a valid value for the name attribute or an input:

name="[ORDER]order_fname"


The $_POST array will be empty on submission.

OTOH, this is valid, but I don't think it will work with the Register snippet:
   name="order_fname[]"


This also returns a value, but if you have more than one order_fname[CONTACT] in the form, the $_POST array will be missing all but one of them.
name="order_fname[CONTACT]"


The resulting array looks like this (not what you want, I think):

array
  'order_fname' => 
    array
      'CONTACT' => string 'hello' (length=5)


The only workable solution, if you're going to use the Register snippet, is to have a unique name (with no [] characters) for each extended field you want to store.

An alternative would be to handle the extended fields yourself in a preHook or postHook.

BTW, user extended fields are not a good place for frequently accessed data. They are slow and cumbersome. If you need to search or sort based on what's in an extended field, you should probably be looking at extending the modUser object: http://bobsguides.com/blog.html/2014/05/27/why-extend-moduser/.]]>
BobRay Feb 03, 2015, 03:01 PM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519871
<![CDATA[Re: Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519862
But you want them in subgroups, according to what? The user is answering questions like what is your age, where do you live, and you are putting that in a *subgroup*?

So we have:

Name Age Location Level
User1 22 Lima Expert
User2 47 Caracas Novice
User3 18 Bogota Expert

This is the normal info in db, and you can query the db to look at info like say average age and what percent are expert or novice, or you could look at only those novice users and their average age.

So I don't understand subgroup, maybe the expert or novice value like this can help you? What groups are there and how to decide who goes in what groups?

Finally, just to let you know, Class Extender makes this issue much easier, and helps you to use the user data you get. I haven't implemented it yet but it looks promising, its quite new.

So, pls tell me your idea more clearly, maybe I can point you in the right direction.]]>
nuan88 Feb 03, 2015, 11:51 AM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519862
<![CDATA[Re: Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519839 Quote from: nuan88 at Feb 03, 2015, 12:54 PM
What is the [CONTAINER] supposed to do? I suspect that the field name is perhaps not valid.

What does container represent here? If the field name was something like user_field1 and user_field2 I think you would be fine.

Is container a variable or something?
this is suppose to create the user's profile extented fields WITHIN a sub Container.See ext fields, you can do any sub"folder" to put inside all ext.fields you need to organize them as needed.
In our cas we will use SimpleCart compnent and need to add a lot of fields (for ORDER data plus DELIVERY data) such as fname, lname, and many more.

From a form point of view I do not know what is correct but name=[vvvv]xxx create correctly the container but no in all calls (??) and, well, it's very confused.]]>
elz064 Feb 03, 2015, 07:13 AM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519839
<![CDATA[Re: Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519838
What does container represent here? If the field name was something like user_field1 and user_field2 I think you would be fine.

Is container a variable or something?]]>
nuan88 Feb 03, 2015, 06:54 AM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519838
<![CDATA[Re: Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519815 Quote from: BobRay at Feb 02, 2015, 04:45 PM
I think each extended field needs a separate input in the form, and that input has to have the same name as the extended field in the DB. I could be wrong.
Yes of course thank you.
That's what I'm doing... see my form extract up there please.
The question is out to deal with ext.fields CONTAINERS
I found I don'i know where it should be done with an in put name= "[CONTAINER]field_name"

But as I told, THIS seams to bug if trying to &validate over it.

That's my problem.
]]>
elz064 Feb 03, 2015, 02:16 AM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519815
<![CDATA[Re: Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519751 ]]> BobRay Feb 02, 2015, 10:45 AM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519751 <![CDATA[Re: Register & validate over extended fields blocks submit ?]]> https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519712 Quote from: BobRay at Jan 30, 2015, 11:04 PM
Do you have this in the tag?

&useExtended=`1`

Yes. Thank you

And ext fields are actually created when the post 's going well.


Have a look to my other post about this issue here :
http://forums.modx.com/thread/95839/login-register-naming-of-extended-fields#dis-post-518873

there's an issue with the creation of extended fields when using container for them.
I'd like to organize the ext fields using sub container for them.
Seams the syntaxe is name=[CONTAINER]name_of_field in forms input.

With that particular use either I got doublon either I got no container (when validating)

in the form :
...
      <label class=" control-label sr-only" for="order_fname">[[%register.fname]] </label>                                                                         
        <div class="form-group has-feedback" >                                                                                                                                 
          <div class=" input-group">                                      
            <span class="input-group-addon">                                            
              <i class="oi oi-people"></i>                                      
            </span>                                                                                                      
            <input class="form-control"  type="text" name="[ORDER]order_fname" id="order_fname" required="required" value="[[!+reg.[ORDER]order_fname]]" placeholder="[[%register.fname]]" />                                             
          </div> 
            <span class="alert live alert-warning"  role="alert">                                                    
              <span class="badge badge-warning">!                                       
              </span>[[!+reg.error.[ORDER]order_fname]] [[%i18n.required? &language=`[[++cultureKey]]` &namespace=`i18ncustom`]]                                        
              <span class="label label-warning">Attention                                       
              </span>                                                
            </span>          [[!+reg.error.[ORDER]order_fname:notempty=`                                 
            <span class="alert">                                      
              <span class="badge badge-warning">!                                       
              </span>            [[!+reg.error.[ORDER]order_fname]]                                 
            </span>`]]
        
        </div>    

...

the 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^,
  [ORDER]order_fname:required
`


&placeholderPrefix=`reg.`
]]
]]>
elz064 Feb 02, 2015, 06:05 AM https://forums.modx.com/thread/96001/register-validate-over-extended-fields-blocks-submit#dis-post-519712