In the registration form I want to include Gender and my work was to integrate a template I had been given in HTML into Modx ... now, in the template, choosing gender was via radios ... something like this ...
<label>Gender :
<span>*</span>
<span class="error">[[+error.gender]]</span>
</label>
<ul>
<li>
<label for="male" class="radio_label">male</label>
<input class="radio"
type="radio"
name="gender"
id="male" tabindex="9" value="male" />
</li>
<li>
<label for="female" class="radio_label">female</label>
<input class="radio"
type="radio"
name="gender"
id="female" tabindex="10" value="female" />
</li>
</ul>
I need to get the male and female values to a placeholder such as [[+gender]] so that I can use it in a profile. Modx provides the [gender] field for user profiles so its not an extended profile.
Now that we’ve got selects out of the way, if I can just figure this one out that would be it! Because checkboxes and radios work in the same way.
Check out how FormIt does it ...
<select name="color">
<option value="blue" [[!+fi.color:FormItIsSelected=`blue`]] >Blue</option>
<option value="red" [[!+fi.color:FormItIsSelected=`red`]] >Red</option>
<option value="green" [[!+fi.color:FormItIsSelected=`green`]] >Green</option>
</select>