How do I pass a hidden input value to plugin onSaveUser event handler? I'm writing a customer portal plugin, utilizing Crafts user registration form: https://craftcms.com/docs/templating/user-registration-form

{# User registration form: #}
&lt;form method="post" accept-charset="UTF-8"&gt;
    {{ getCsrfInput() }}
    &lt;input type="hidden" name="action" value="users/saveUser"&gt;
    &lt;input type="hidden" name="redirect" value=""&gt;

    {# What do I add / change ? #}

    {# ... #}
&lt;/form&gt;


 
My plugin has two different types of account profile records, .._OrganizationProfileRecord and .._UserProfileRecord. What I want to do is send a variable to the onSaveUser event handler in my plugin main class, to tell it what type of user was just saved ("org" or "user"), and then take appropriate actions, i.e. create either an organization or user profile.

class myPortalPlugin extends BasePlugin
{
    public function init()
    { 
        craft()-&gt;on('users.onSaveUser', function(Event $event)
        {
            $craftUser = $event-&gt;params['user'];
            $isNewUser = $event-&gt;params['isNewUser'];

            if ($isNewUser)
            {
                // Check if user is an organization or a regular user, and
                // create the appropriate profile record.

                // How do I check?

                // ...
        }
    }

    // ...
}




Questions: 


How would I go about passing data/variable from the form to the onSaveUser event handler?
Is there a better / more convenient way to do this?


Many thanks in advance for any help you can provide in this matter!  bowing

/Monkey
I found a solution. Though I am not sure if this is the best way to go about it, but here's what I did:

&lt;input type="hidden" name="userType" value="org"&gt;


was added to the register form, and ...

$userType = craft()-&gt;request-&gt;getPost('userType');

if ($userType == 'org')
{
    // ...


was added to the onSaveUser event handler function.