1

The safecracker form related custom fields are being submitted, the problem is the select drop-down categories. After having chosen the category to associate the entry with, the respective category does not remain selected in the CP.

I'm using the User Guide Code

<select name="category[]" id="categories">
{categories}
<option value="{category_id}"{selected}>{category_name}</option>
{/categories}
</select>
4
  • To clarify - you submit the entry via Safecracker, but when you view the same entry in the CP, no categories are selected (but all other data is there)? Feb 22, 2013 at 13:14
  • Hi Derek, exactly, that's the issue. Feb 22, 2013 at 14:59
  • Can you post the complete code of the template to pastie.org?
    – Anna_MediaGirl
    Feb 22, 2013 at 16:44
  • Hi Anna, here is it pastie.org/6317924 Thanks Feb 22, 2013 at 18:25

1 Answer 1

1

I tested this and seems tot work correctly (EE 2.5.5). if you want to preserve already selected categories, you could make your select a multi-select.

<select name="category[]" id="categories" multiple="multiple">
...
</select>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.