How to hide field for new entry, but show it when updating entry?

By: Alex Barron | Asked: 06/20/2022
ForumsCategory: How-toHow to hide field for new entry, but show it when updating entry?
Alex BarronAlex Barron asked 2 years ago
I have a field "Goal Status" which is automatically set to "active" when a new "Goal" (custom post type) is created from filling in the form. Therefore, I don't want to show that field when creating a new entry. However, when the user wants to edit the entry on the front end, I want to show that field so that they can set it to "Completed" or "Archived". I don't see anything in the interface to allow this. The Conditional Logic option for the field doesn't do what I need.   I have already tried creating 2 forms: 1 for new entry and for 1 updating existing entries. However, due to only being able to link a View to 1 form, the fields are not autopopulated when editing an entry (because I linked the View to the New Entry form).   Thanks in advance!
1 Answers
Victor Font answered 2 years ago
You can use conditionals triggered by hidden fields to do what you want, but it's hard to say for certain without fully understanding your design. You can also display only specified fields on your form when you first load it on the page. Don't include the fields that store the status. See this knowledge base article for details: https://formidableforms.com/knowledgebase/publish-a-form/#kb-parameters
Alex BarronAlex Barron replied 2 years ago

<p><p>Thanks Victor.<br />1. Being able to specify fields to include via the shortcode is handy, but this solution would still mean i would have 2 edit pages, correct? 1 with the shortcode that includes the fields for a new entry, and another with the other shortcode including the fields for updating an entry. Is that how you could see it working?</p><p>2. Why should I avoid using my Goal Status field?</p><p>3. What would you need to know in order to fully understand my design? I will be as clear as possible.</p></p>

Victor Font replied 2 years ago

Yes, the alternative is to hide what you don't want shown with CSS or a combination of CSS and jQuery to hide/show elements on the screen whether in entry or edit mode. This could be a lot of work depending on your design and how dynamic your requirements are.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right