3 Posts
Gaukeleier
10 years ago
2
Topic
Hello seblod-team!

Could someone explain me how to setup a dropdown-field in the registration form,
that allows the user to choose a usergroup?
I really dont get it to work :(

So 1000 thanks for your help!!!

Greetings
Jascha
Get a VIP membership
48 Posts
OpenEX
10 years ago
0
Level 1
Hello Gaukeleier.
You probably mean a <select> field with <option>s. If that's the case i can suggest only a tricky way because as i know user groups can be set up Joomla way by user on front-end only during registration process because of lack of rights after you are logged in.
Before someone answers better way..

1. During registration. So i think you could to add a "user groups field" hide them from the user's sight and set proper checkboxes via javascript and onchange event for example.

2. If you feel it can be "hacked" you may try to do groups ascribing in the backend trying to change $_POST data before they are processed by Joomla/Seblod. So you could check how user groups POST data look like and set proper values depending how your $_POST['yourselect'] data look like - what option has been selected. To put some PHP code you there is the 42 field. You can create your own field using deveper plugin can be downloaded on Seblod and create your own custom field.

3. I don't know whether it is good for your case but Seblod offers triggers and event or so to change values between different fields of the form. You know there is a field, it is changing, another field is changing too. I have no actual experience with that.

48 Posts
OpenEX
10 years ago
0
Level 1
You can probably also try using "User Group Parent Id" to allow only certain range of user groups to be assigned but i am not sure :) .
Get a VIP membership