WSN Links
Separate Registration Forms by Usergroup
Separate Registration Forms by Usergroup
By Paul

Sometimes you may want to ask different registration questions to people depending on what usergroup they're registering to. For example, a site might have "buyer" and "seller" usergroups which need to collect different information.

First, create the additional usergroups you want at Admin -> Members -> Manage Usergroups. Then select them as allowed registration usergroups at Admin -> Members -> Settings.

At Admin -> Templates -> Manage Templates, you can create custom templates for each of the special registration forms. Copy the regular registration template and modify it as desired.

Find the usergroup selector:
<tr>
<td class="labelscolumn"><span class="labels">{LANG_PROFILE_USERGROUP}:</span></td>
<td class="optionscolumn"><select name="usergroup">{USERGROUPOPTIONS}</select></td>
</tr>
Replace that with a hidden input field specifying the usergroup number applicable to that form:
<input type="hidden" name="usergroup" value="6" />
for group #6 for example.

You'll also need to add a couple more hidden input fields (anywhere, but let's say just above the submit button) to make the special template stick on an incomplete form submission reload:
<input type="hidden" name="TID" value="templatename" /><input type="hidden" name="custom" value="yes" />

Replace templatename with the name of the custom template.

Finally, replace the standard registration template with a list of links to the special registration templates:

<a href="register.php?custom=yes&TID=buyerregistration">Register in the buyers group</a>
or
<a href="register.php?custom=yes&TID=sellerregistration">Register in the sellers group</a>


That's all.

Rating:


0/5 based on 0 votes. The median rating is 0.

Submitted: 02/05/09 (Edited 02/05/09)

Description: How to have people use a different form to sign up depending on what usergroup they want to join.

Views: 239 views. Averaging 0 views per day.
In the most recent 30 day period, there've been 2 views.

Previous Article | Next Article

Features Showcase Reviews Purchase Services Resources Support