How to set usertype by drop down (Joomla Registration)

elove 14 Oct, 2013
I'm building a subscription form with Joomla Registration enabled. I would like the usertype to be set depending on the the selection from a drop down menu. Ex: I have four usertypes, in the form if the user selects option "A", then I want the usertype to be "A".

In the parameter settings for the Joomla User Registration action, I see where I can multi-select a usertype but I don't see an option to set by selection.

Is there a way to configure or code this?

I'm using ChronoForms V4, Joomla 2.5, form is here (under development): http://www.realtimesmedia.com/eedition/index.php?option=com_chronoforms&chronoform=Subscribe
elove 11 Feb, 2014
Hi I couldn't follow the example in the link you provided, but I found another link that is better suited to what I'm trying to accomplish. Here is the link:
http://www.chronoengine.com/faqs/61-cfv4/cfv4-tutorials/4618-how-can-i-add-a-user-to-a-user-group.html


Here is what I have written which seems closer to what I'm trying to accomplish but it still does not work... I'm not sure if I'm putting the action in the wrong place? But it's after the Joomla Registration Action

<?php
if ( !isset($form->data['location']) || !$form->data['location'] ) {
  // there is no location selected
  return false;
}

$group_id = $form->data['location'];
$user_id  = $form->data['_PLUGINS_']['joomla_registration']['id'];
jimport( 'joomla.user.helper' );
JUserHelper::addUserToGroup($user_id, $group_id);
?>


Location is the name of the variable the user selects to determine the user type. If the user is subscribing to the the Michigan location, his user group becomes Michigan - were he can only access Michigan features etc...

Thanks!
elove 11 Feb, 2014
Also, I have set the location variables to equal the group id as stated in the directions. I noticed that it sets the user group by the pre-selected usertype parameter in the Wizard (see attachment)
omidhz 11 Mar, 2014
I need to do the same thing: user select their usertype when they register on the website. Did you figure out how to do so?
Any help will be much appreciated.
elove 12 Mar, 2014
No, no one replied yet... I may open a new thread
omidhz 12 Mar, 2014

No, no one replied yet... I may open a new thread


I just did: https://www.chronoengine.com/forums/posts/t95145.html
This topic is locked and no more replies can be posted.