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>
  • 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)? – Derek Hogue Feb 22 '13 at 13:14
  • Hi Derek, exactly, that's the issue. – lincolnpixel Feb 22 '13 at 14:59
  • Can you post the complete code of the template to pastie.org? – Anna_MediaGirl Feb 22 '13 at 16:44
  • Hi Anna, here is it pastie.org/6317924 Thanks – lincolnpixel Feb 22 '13 at 18:25
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>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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