Support

Account

Home Forums General Issues Editing a Radio Button Field Resets Choice to First Available

Solving

Editing a Radio Button Field Resets Choice to First Available

  • I’m doing some updates / enhancements to my ACF Pro fields. I have a radio button field that is currently actively being used by several pages on the site. I noticed that when I make an update to the radio button field by adding another choice, it seems to reset all of the fields on all of the pages that use it to the first available radio button choice.

    Example:

    Original choices:
    file : PDF File
    internal link : Button Link Internal
    external link : Button Link External

    New Choices:
    file : PDF File
    internal link : Button Link Internal
    external link : Button Link External
    blog link : Button Blog Post

    A page that previously had the 2nd or 3rd choice selected now has the 1st choice selected (PDF File). Note, no data is lost, it’s just that we need to go though all the pages manually to reset the originally chosen option. Is there a way to avoid this in the future? Is there a setting I’m missing somewhere?

    Please advise. Thank you very much.

  • may I get original source please?

  • Hi,

    There isn’t really any “source” as I made these changes in the ACF GUI.

    I was able to get this from the ACF backup I took of the custom field before I made the change:

    {
     "key": "field_5d1471e8f999d",
     "label": "File or Link?",
     "name": "file_or_link",
     "type": "radio",
     "instructions": "",
     "required": 0,
     "conditional_logic": 0,
     "wrapper": {
        "width": "",
        "class": "",
        "id": ""
      },
     "choices": {
        "file": "PDF File",
        "internal link": "Button Link Internal",
        "external link": "Button Link External"
     },
     "allow_null": 0,
     "other_choice": 0,
     "default_value": "",
     "layout": "vertical",
     "return_format": "value",
     "save_other_choice": 0
    },

    And after I made the change:

    {
     "key": "field_5d1471e8f999d",
     "label": "File or Link?",
     "name": "file_or_link",
     "type": "radio",
     "instructions": "",
     "required": 0,
     "conditional_logic": 0,
     "wrapper": {
        "width": "",
        "class": "",
        "id": ""
     },
     "choices": {
        "file": "PDF File",
        "internal link": "Button Link Internal",
        "external link": "Button Link External",
        "blog link": "Button Blog Post"
     },
     "allow_null": 0,
     "other_choice": 0,
     "default_value": "",
     "layout": "vertical",
     "return_format": "value",
     "save_other_choice": 0
    },

    I would send screen shots but that doesn’t seem possible.

    Thanks.

  • I created a radio button like your first, set a value on a post, then I altered the button as you have and I did not see any change to the selected value on the post.

    I do not know what is causing this, but ACf seems to be functioning correctly.

    It could be any number of things: another plugin, something in the theme, another field, a filter of some kind.

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

You must be logged in to reply to this topic.