Hi all
I'm using Login.Register to register my users... All works fine if the property '&usergroups' is "hard-coded" like that
[[!Register?
&submitVar=`registerbtn`
&activationResourceId=`57`
&activationEmailTpl=`activationEmailTpl`
&activationEmailSubject=`Thanks`
&submittedResourceId=`70`
&usergroups=`Group1,Group2`
&validate=`nospam:blank,
username:required
password:required,
password_confirm:password_confirm=^password^,
name:required`
&placeholderPrefix=`reg.`
]]
Now I need to let my users choose the Group they will be assigned. So I put some checkboxes in my form and then I'm facing 2 problems:
1/ the values of the checked checkboxes are not 'transmitted' in the hidden field :
Having a look at the $_POST and I see groups[] groups[]=Group1 groups[]=Group3 (in the case I checked Group1 and Group3)-
In the email activation [[+groups]] is printed as it is [[+groups]], but if I put [[+groups.0]], [[+groups.1]] [[+groups.2]] the checked values are returned and others return [[+groups.n]]
2/ I can't find a way to set the property '&usergroups' dynamically with the values of the checkboxes.
Here the code for the checkboxes
<input type="hidden" name="groups[]" value="" />
<input type="checkbox" class="styled" name="groups[]" value="Group1" [[!+reg.groups:isChecked=`Group1`]] > G1 Member</input>
<input type="checkbox" class="styled" name="groups[]" value="Group2" [[!+reg.groups:isChecked=`Group2`]] > G2 Member</input>
<input type="checkbox" class="styled" name="groups[]" value="Group3" [[!+reg.groups:isChecked=`Group3`]] > G3 Member</input>
The 'isChecked' modifier is a basic copy/paste of the formitIsChecked snippet.
INSTALLATION :
Revolution 2.2.0-rc3 from git
WAMP server install on Windows7
PHP 5.3.8
MySQL server: 5.5.16-log
MySQL Client : mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $
I'm facing a wall and any help would be appreciated
Thanks in advance
[ed. note: anso last edited this post 13 years, 2 months ago.]