Support

Account

Home Forums ACF PRO Creating a checkbox option on the front end to effect another checkbox

Helping

Creating a checkbox option on the front end to effect another checkbox

  • I am working on a sort of intranet where there are different user levels that have access to certain areas of the website.

    I am creating a form on the front end and am having a checkbox area so that if the user checks it, that area then becomes available.

    I currently have a ACF checkbox field for users so that i can select which areas they can access, but i am also creating a form on the front end where users can opt-in to get access to areas.

    So the idea is that they access the form on the front end and if they tick the checkbox and submit the form, it will automatically check the other ACF checkbox for that user to turn that area on. Is that possible for 2 fields to communicate to each other, and if so how can i do so?

    Thanks

  • You would use a combination of an acf/save_post filter https://www.advancedcustomfields.com/resources/acfsave_post/ and update_field() https://www.advancedcustomfields.com/resources/update_field/

    In the save post filter you would get the value from the checkbox submitted and update the other checkbox.

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

The topic ‘Creating a checkbox option on the front end to effect another checkbox’ is closed to new replies.