Support

Account

Home Forums Front-end Issues Disabling fields in ACF forms

Solved

Disabling fields in ACF forms

    • JAdams

    • November 19, 2020 at 10:23 am

    Is it possible to modify ACF forms in php so the front-end form field renders as a div instead of a form field?

    I want specific fields to be locked and uneditable in the front end.

  • Is it possible?

    Yes. You could create an acf/prepare_field filter https://www.advancedcustomfields.com/resources/acf-prepare_field/.

    In this filter you could convert the field from whatever type of field it is into a message field to show the value of the field as a the message.

    Alternately, for some type of fields, you can disable them or make them read only.

    • JAdams

    • November 22, 2020 at 8:47 am

    Yes!

    This seems to be the key to what im looking for!

    I am having an issue with it though,
    “Message” fields use a “message” value to hold what they display.

    I cant figure out how to pass the previous value into the “message”.

    • JAdams

    • November 22, 2020 at 10:29 am

    Nevermind!

    This actually worked perfectly

    I accidently used load_value instead of prepare_field, leftover from my previous attempts.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.