I have a safecracker form for updating a channel.
Most of it is working ok but I am not sure how to display this following category fields so that if the category is already selected, it will show on the update form:
<label for="country_of_residence" class="required">Country:</label>
<select name="country_of_residence" id="country">
<option value="">Select Country</option>
{exp:channel:categories channel="zoo_visitor" category_group="1" parent_only="yes" style="linear" parse="inward"}
<option value="{category_name}"}>{category_name}</option>
{/exp:channel:categories}</select>
<label for="region" class="required">Region:</label>
<select name="category[]" id="region">
<option value="">Select Region</option>
{exp:channel:categories channel="zoo_visitor" 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>