Skip Navigation

[Resolved] Hide populated fields when editing a form

This thread is resolved. Here is a description of the problem and solution.

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.

This topic contains 4 replies, has 2 voices.

Last updated by andrewD-10 1 year, 1 month ago.

Assigned support staff: Minesh.

Author
Posts
#1801055

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: hidden link

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

#1801777

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

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?

#1803847

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

#1803961

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

[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

#1805019

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