My setup:
I have an APC frontend form. Users can create new posts. The form has some mandatory fields, like title, category, textarea etc., and some optional ones.
The issue is about the category field. It’s a REQUIRED dropdown select field (no multiple choices).
The post creation feed has post editing enabled with the exclusion of title and category.
Post creation works well, category is set correctly.
Here comes the problem part.
When the user wants to edit his own post on the frontend the post creation form appears again. Remember, the title and category fields can’t be edited (no permission).
BUT the category field is empty (nothing selected). Since the category field is a REQUIRED field but empty the form can’t be submitted again after editing.
How can I make the category field keep its initial choice so the form can be submitted and doesn’t run into the REQUIRED fields submission error?
Or any other best practice advice?
Hi Andre. When using the Advanced Post Creation Add-On, you should not use any fields from the “Post Fields” section of the form builder. We explain the limitation in the documentation here:
Note: You cannot use Post Fields in Advanced Post Creation. This means the fields of Post Body; Post Category; Post Custom Field; Post Excerpt; Post Image; Post Tags; and Post Title are not for mapping in an Advanced Post Creation feed. Use Standard or Advanced fields instead. Refer to Advanced Post Creation vs Post Fields for additional information.
To provide a list of categories in a dropdown, please add a dropdown field from the Standard fields, and give it a Custom CSS Class: of ‘populate-categories’ on the Appearance tab: