Blog Sections Open

Switching Between Two WebLoginPE Registration Forms with Radio Buttons

A practical pattern for projects that need separate registration forms, templates, or user groups on a single entry page.

A common marketplace or directory requirement is to let users choose between two registration types on the same page, such as clients and contractors. In Evolution CMS this is easiest when you treat the two forms as separate WebLoginPE calls and switch the visible form with JavaScript.

The clean approach

  1. Create two distinct WebLoginPE calls.
  2. Give each call its own form template, redirect rules, and default user group.
  3. Render both wrappers on the page, but show only one at a time.
  4. Use radio buttons or tabs to switch the visible block.
<label><input type="radio" name="role" value="client" checked> Client</label>
<label><input type="radio" name="role" value="contractor"> Contractor</label>

<div id="form-client">[!WebLoginPE? &tpl=`tplClientRegister` &groups=`Clients` !]</div>
<div id="form-contractor" style="display:none;">[!WebLoginPE? &tpl=`tplContractorRegister` &groups=`Contractors` !]</div>

Why this works better than one giant conditional form

It keeps the form logic readable. Each audience gets its own fields and user-group rules, and editors do not have to maintain a single overloaded template full of conditionals.

If the two flows start to diverge even further, move them to separate URLs and keep the radio-button page only as a landing selector.

Newer post

Keeping Square Brackets Intact When Outputting TV Content

How to prevent array-like data from breaking when a TV contains square brackets and is rendered directly in a template.

Older post

Showing Protected Output Only to Logged-In Managers with a Tiny Snippet

A minimal Evolution snippet pattern for showing content only to authenticated manager users.