Inicio › Toolset Professional Support › [Resuelto] Hide populated fields when editing a form
Problem:
Hide populated fields when editing a form
Solution:
Edit post form is intended to show the content of the post which you currently edit.
If you remove the field values, then the original field values where even you will not make any change will not be get saved.
we do not advise to mimic with the original edit form behaviour as if we make any changes to it sooner or later there is a chance that it can be broken.
You can find the proposed solution in this case with the following reply:
=> https://toolset.com/forums/topic/hide-populated-fields-when-editing-a-form/#post-1801777
Relevant Documentation:
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
Etiquetado: Content-submission forms, CRED API, Toolset Forms
Documentación relacionada:
Este tema contiene 4 respuestas, tiene 2 mensajes.
Última actualización por andrewD-10 hace 4 años, 3 meses.
Asistido por: Minesh.
Tell us what you are trying to do?
Hi toolset,
When I go to a post form to edit an existing post, the fields are pre-populated with the corresponding values. What I would like to do is hide the values in each of the fields so that the form is completely blank. And whatever I populate the field with, will override the existing value, and whatever I do not populate the form will keep the existing fields as-is. This is useful when I don't want customers to see what the field's value is before they input their own value.
This video will help explain better: enlace oculto
If this doesn't work, is there a way to have a blank form that adds a new line item in a custom field every time it is filled out?
Thank you,
Andrew
Hello. Thank you for contacting the Toolset support.
Your requirement is different than how the edit form works.
Because - edit form is intended to show the content of the post which you currently edit.
If you remove the field values, then the original field values where even you will not make any change will not be get saved.
I do not advise to mimic with the original edit form behaviour as if we make any changes to it sooner or later there is a chance that it can be broken.
I advise you to think another workaround.
What if you create another post type "Custom Edits" and then create a one-to-many post relaitonship between your current post type post which you want to edit and post type "Custom Edits". Then, create a add new post form for post type "Custom Edits" and link it to the original edit entry - will that work?
Hi Minesh,
I understand what you mean, I would rather not add a custom post type, but will consider this.
Is there any way to mask the field with like a style, or maybe have it show a placeholder instead of the value?
Thank you,
Andrew
[cred_field] shortcode supports the placeholder attribute that you should use to add the placeholder for your fields:
More info:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field
Thank you Minesh for taking the time to help me. Ill see about going with the first solution you mentioned. It would be cool in the future to have a "hidden value" PHP code on fields we want to hide the value for.
Thank you,
Andrew