I am using zoo visitor to register members onto a site. Some member groups are required to select their country which is saved in their entry as a category.
There is also a region field which is a sub category list linked to the country.
I have all the required field errors set inline but am not sure how I would require the country category (and if possible the region if it was present)
Here is the relevant section of my code :
{exp:zoo_visitor:registration_form return='/register/success' allowed_groups="7|8" datepicker="yes" error_handling="inline" rules:country="required"}
<label for="mobile" class="required">Mobile number:</label>
<input type="text" name="mobile" id="mobile" value="{mobile}" />
<span class="error"> {error:mobile}</span><br>
<label for="country_of_residence" class="required">Country:</label>
<select name="category[]" id="country" class="quicksearch region_optional">
<option value="">Select Country</option>
{exp:channel:categories category_group="1" parent_only="yes" style="linear" parse="inward"}
<option data-name="{category_name}" value="{category_id}">{category_name}</option>
{/exp:channel:categories}</select>
<br><span class="error"> {error:country}</span>
<label for="regions" class="required">Region:</label>
<select name="category[]" id="regions" class="quicksearch">
<option value="">Select Region</option>
{exp:channel:categories disable="category_fields" style="linear"}
{if parent_id == '0'}{if count != '1'}</optgroup>{/if}<optgroup label="{category_name}">{/if}
{if parent_id != '0'}<option value="{category_id}">{category_name}</option>{/if}
{/exp:channel:categories}
</select> <br>
{/exp:zoo_visitor:registration_form}