Home Forums Front-end Issues Dynamically change acf_form checkbox field Reply To: Dynamically change acf_form checkbox field

  • Thanks John, Thanks for this, I’ll take a look into it.

    To expand on some detail. I have a custom post type called campaigns. Each campaign post has a custom taxonomy associated with that post. (you can do this with some filters of what meta boxes display on the right column of the edit admin screen – so it is kind of faking it since all the taxes are really associated with the post type.). I do this because I need the user to be able to create different categories in the different taxonomies that only show on that specific post admin screen.

    In the front end acf_form() I load the list of campaigns, once the users selects a campaign, I then need to load the taxonomy associated with that campaign. I have ajax that sends the campaign post ID after the user selects. I then need to load or reload the taxonomy checkbox field that is associated with that selected campaign post. On the backend I’m using acf/load_field/ filter to alter which taxonomy loads based on what campaign the user has selected.

    I’m hoping to do that load/reload in an ACF way (either by loading the field HTML on the server and sending it back in the ajax, though I don’t think this will work because it appears that ACF uses a load of javascript to actually create the fields and values, or loading the taxonomy (field options) in a JSON config and then sending that through ACF javascript that loads with the acf_form() and header functions.)