Here is what I am trying to do.
I am using Safecracker to do the add/edit posting, but when the user click on a checkbox, then go to edit the posting, the check box is not there.
I am using Gwcode Categories Plugin, outputting my categories as checkboxes because it has more feature and flexibility then the built in safecracker categories tag
GWCode Categories
<ul>
{exp:gwcode_categories group_id="9"}
<li>
<input type="checkbox" id="categories" name="category[]" value="{cat_id}" {checked} />
<span>{cat_name}</span>
</li>
{/exp:gwcode_categories}
</ul>
but when I use Safecracker
<ul>
{categories}
<li><input type="checkbox" name="category[]" id="categories" value="{category_id}" {checked} />
<span>{category_name}</span> </li>
{/categories}
</ul>
the checkbox is there. why I cant just used the {checked} in the Gwcode Categories and why does it have to be in {categories}{/categories}
here is the code that I have right now and trying to do with safecracker
{exp:gwcode_categories group_id="9"}
{if has_children && parent_id == '0' }
<!-- parent with children -->
<li class="checkbox checkbox_parent">
<span><b>{cat_name}</b></span>
</li>
{if:elseif depth == 2}
<!-- child at second level -->
<li class="checkbox">
<input type="checkbox" id="categories" name="category[]" value="{cat_id}" checked="{checked}" />
<span>{cat_name}</span>
</li>
{if:elseif depth == 3}
<!-- child at third level -->
<li class="checkbox">
<input type="checkbox" id="categories" name="category[]" value="{cat_id}" checked="{checked}" />
<span>{cat_name}</span>
</li>
{if:else}
<!-- parent with no children -->
<li class="checkbox_parent_nochild">
<input type="checkbox" id="categories" name="category[]" value="{cat_id}" checked="{checked}" />
<span>{cat_name}</span>
</li>
{/if}
{/exp:gwcode_categories}